Skip to content

aben20807/vim-surrounder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Surrounder

1. Installation

1.a. Installation with Vim-Plug

  1. Add Plug 'aben20807/vim-surrounder' to your vimrc file.
  2. Reload your vimrc or restart.
  3. Run :PlugInstall

1.b. Installation with Vundle

  1. Add Plugin 'aben20807/vim-surrounder' to your vimrc file.
  2. Reload your vimrc or restart
  3. Run :PluginInstall

2. Usage

2.a. Supported symbols

  • '', "", (), [], {}, <>

2.b. Demonstration

  • Note: marked text is cursor position.
Before key pressed After
hello world <leader>s " "hello" world
hello world 2<leader>s " "hello world"
  • Use auto detect
Before key pressed After
"hello world" <leader>d hello world
"hello world" <leader>f ( (hello world)
  • Not use auto detect
Before key pressed After
"hello world" <leader>d " hello world
"hello world" <leader>f "( (hello world)

2.c. Settings

" 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

img