1.a. Installation with Vim-Plug
- Add
Plug 'aben20807/vim-surrounder'
to your vimrc file. - Reload your vimrc or restart.
- Run
:PlugInstall
1.b. Installation with Vundle
- Add
Plugin 'aben20807/vim-surrounder'
to your vimrc file. - Reload your vimrc or restart
- Run
:PluginInstall
- '', "", (), [], {}, <>
- Note:
Before | key pressed | After |
---|---|---|
he llo world |
<leader>s " |
"he llo" world |
he llo world |
2<leader>s " |
"he llo world" |
- Use auto detect
Before | key pressed | After |
---|---|---|
"he llo world" |
<leader>d |
he llo world |
"he llo world" |
<leader>f ( |
(he llo world) |
- Not use auto detect
Before | key pressed | After |
---|---|---|
"he llo world" |
<leader>d " |
he llo world |
"he llo world" |
<leader>f "( |
(he llo world) |
" Feel free to change mapping you like.
" Use key mappings setting from this plugin by default.
let g:surrounder_use_default_mapping = 1
" Add surround in n mode
let g:surrounder_n_add_key = "<leader>s"
" Add surround in v mode
let g:surrounder_v_add_key = "<leader>s"
" Delete surround in n mode
let g:surrounder_n_del_key = "<leader>d"
" Replace surround in n mode
let g:surrounder_n_rep_key = "<leader>f"
" Show the surround information by default.
let g:surrounder_show_info = 1
" Auto detect if in surround symbols by default.
let g:surrounder_auto_detect = 1