The simplest implementation of auto completing quotes and brackets.
- Vim-Plug
Plug 'solvedbiscuit71/vim-autopair'
- Packer
use 'solvedbiscuit71/vim-autopair'
- Use other plugin manager
The current content, where |
is the cursor
foo|
Press the (
key,
foo(|)
Now, pressing the )
key will skip it.
foo()|
Now, press the {
key and press <CR>
key
foo(){
|
}
Now, press "
key the content becomes
foo(){
"|"
}
Now, pressing the <BS>
will remove the pairs
foo(){
|
}
This plugin also supports auto closing tags for html which only in HTML files.
>
triggers auto closing/
triggers auto closing as single tag i.e<br/>