All Projects → itmammoth → doorboy.vim

itmammoth / doorboy.vim

Licence: other
Vim plugin for auto closing brackets ( => (|) and quotations " => "|" , and more

Programming Languages

Vim Script
2826 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to doorboy.vim

miniSnip
Lightweight snippet plugin for Vim
Stars: ✭ 45 (+136.84%)
Mutual labels:  vim-plugin
vim-emberlayout
Open Ember files in a grid
Stars: ✭ 18 (-5.26%)
Mutual labels:  vim-plugin
ime.vim
A Vim input method engine
Stars: ✭ 74 (+289.47%)
Mutual labels:  vim-plugin
vim-pairs
Punctuation text objects: ci/ da; vi@ yiq da<space> ...
Stars: ✭ 35 (+84.21%)
Mutual labels:  vim-plugin
stable-windows
Keeps vim windows stable on layout changes
Stars: ✭ 41 (+115.79%)
Mutual labels:  vim-plugin
vim-strip-trailing-whitespace
🎞️ Vim plugin that removes trailing whitespace from *modified* lines on save
Stars: ✭ 66 (+247.37%)
Mutual labels:  vim-plugin
vim-readme-viewer
📖 Viewing plugin's README easily like vim help
Stars: ✭ 26 (+36.84%)
Mutual labels:  vim-plugin
vim-sass-colors
sass/scss/less/css color literal and color variable highlighting (works with imports)
Stars: ✭ 24 (+26.32%)
Mutual labels:  vim-plugin
vim9-stargate
modern alternative to easymotion written in vim9
Stars: ✭ 76 (+300%)
Mutual labels:  vim-plugin
Extract
👻 Neovim yank ring plugin with completion for registers, ring, pinning, and replacing with register.
Stars: ✭ 39 (+105.26%)
Mutual labels:  vim-plugin
vim-mdnquery
Query the Mozilla Developer Network documentation without leaving Vim
Stars: ✭ 19 (+0%)
Mutual labels:  vim-plugin
yaml-vim
YAML syntax/indent plugin for Vim
Stars: ✭ 37 (+94.74%)
Mutual labels:  vim-plugin
bracketstoix
Brackets Utility Belt
Stars: ✭ 46 (+142.11%)
Mutual labels:  brackets
OpenSCAD connectors
Simple, parametric APIs for connectors such as corner brackets and t-joints. Specializing on connectors for aluminum extrusion connectors.
Stars: ✭ 29 (+52.63%)
Mutual labels:  brackets
bash-support
Edit Bash scripts in Vim/gVim. Insert code snippets, run, check, and debug the code and look up help.
Stars: ✭ 76 (+300%)
Mutual labels:  vim-plugin
PICO-8.vim
A vim plugin package for PICO-8 programming.
Stars: ✭ 42 (+121.05%)
Mutual labels:  vim-plugin
skim.vim
vim support for skim
Stars: ✭ 127 (+568.42%)
Mutual labels:  vim-plugin
vim-plugin-autosess
Vim plugin: auto save/load sessions
Stars: ✭ 32 (+68.42%)
Mutual labels:  vim-plugin
vim-syntax-christmas-tree
Vim filetype plugin for X'mas
Stars: ✭ 20 (+5.26%)
Mutual labels:  vim-plugin
vim-viler
Editable file explorer for Vim
Stars: ✭ 24 (+26.32%)
Mutual labels:  vim-plugin

doorboy.vim

Build Status

doorboy.vim is a smart plugin that serves you around brackets((){}[]) and quotations('`").

Screenshot

Installation

vim-plug

Add this to your .vimrc file.

Plug 'itmammoth/doorboy.vim'

Then, :PlugInstall

dein.vim

Add this to your .vimrc file.

call dein#add('itmammoth/doorboy.vim')

Then, :call dein#install()

Vundle

Plugin 'itmammoth/doorboy.vim'

... and many other plugin managers.

Features

Auto closing brackets with ( { [

(| represents the cursor position)

Type: (
Then: (|)
Auto closing quotation with " ' `
Type: "
Then: "|"

Auto closing brackets and quotations works properly in the cursor context.

Skipping close brackets and quotations
When: 'string|'
Type: '
Then: 'string'|
Pushing away brackets
When: {|}
Type: <Space>
Then: { | }
Enhanced backspace
When: { | }
Type: <BS>
Then: {|}
Type: <BS>
Then: |
Smart new line
When: {|}
Type: <CR>
Then: {
        |
      }

Configuration

key-mappings

doorboy.vim automatically provides some key-mappings to you.

Quotations
  • " ' `
  • | / on filetype ruby
  • / on filetype javascript and perl
Brackets
  • ( { [
  • ) } ]
Spaces
  • <BS>
  • <Space>
  • <CR>
NOTICE:

doorboy.vim NEVER overwrites the mapping with <BS>,<Space> and <CR> if these keys are already taken, so in such a case, you need to add the preferred mappings to your .vimrc file.

Available mapping functions are

  • doorboy#map_backspace
  • doorboy#map_space
  • doorboy#map_cr

For instance (to go with neocomplete + endwise)

" inoremap <expr> <CR> (pumvisible() ? "\<C-y>" : "" ) . "\<CR>"
inoremap <CR> <Plug>MyCR
inoremap <expr> <Plug>MyCR (pumvisible() ? "\<C-y>" : "" ) . doorboy#map_cr()

" inoremap <expr><BS> neocomplete#smart_close_popup()."\<BS>"
inoremap <expr><BS> neocomplete#smart_close_popup().doorboy#map_backspace()

g:doorboy_additional_quotations

In the doorboy definition, quotation means one character that opens a specific literal and closes it as well.

You can add quotations with letting g:doorboy_additional_quotations variable.

"
" g:doorboy_additional_quotations must be a dictionary,
" and which has filetypes as its keys and quotations as its values.
" (filetype '*' means any filetypes.)
"
let g:doorboy_additional_quotations = {
  \ '*': ['@'],
  \ 'coffee': ['/']
  \ }

If you find your customizing useful for all vimmers, please just send me a pull request. Thanks.

g:doorboy_nomap_quotations

You can keep some quotations from being mapped by doorboy with letting g:doorboy_nomap_quotations variable.

let g:doorboy_nomap_quotations = {
  \ 'javascript': ['/']
  \ }

g:doorboy_additional_brackets

You can add brackets with letting g:doorboy_additional_brackets variable.

let g:doorboy_additional_brackets = {
  \ 'html': ['<>']
  \ }

g:doorboy_nomap_brackets

You can keep some brackets from being mapped by doorboy with letting g:doorboy_nomap_brackets variable.

let g:doorboy_nomap_brackets = {
  \ 'vim': ['{}']
  \ }

Contribution

Fork it, then run the commands below for vim-flavored testing.

$ bundle install
$ git clone https://github.com/slim-template/vim-slim.git vim-slim
$ rake test

(The slim ftplugin in dooboy requires vim-slim, so you need to git-clone it in your workspace.)

blankslate.vimrc is an essential vim script file for manual testing.

$ vim -u blankslate.vimrc

Now you can try vim plugged in doorboy.vim

License

MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].