More vim surround shortcuts ,} ,] ,) ,' etc

This commit is contained in:
yan 2012-05-09 17:54:30 -07:00
parent 6cefaf13f7
commit 5b8742e226
2 changed files with 28 additions and 2 deletions

View File

@ -333,7 +333,7 @@ files contain key mappings as well (TODO: probably will move them out to skwp-ke
* `Cmd-'` and `Cmd-"` to change content inside quotes
* Cmd-Space to autocomplete. Tab for snipmate snippets.
* `,ci` to change inside any set of quotes/brackets/etc
* `,#` and ',"' to surround a word in #{ruby interpolation} or "quotes"
* `,#` `,"` `,'` `,]` `,)` `,}` to surround a word in these common wrappers. the # does #{ruby interpolation}. works in visual mode (thanks @cj)
#### Tab Navigation

View File

@ -40,8 +40,34 @@ imap <silent> <D-D> -
" ,# Surround a word with #{ruby interpolation}
map ,# ysiw#
" ,# Surround a word with quotes
vmap ,# c#{<C-R>"}<ESC>
" ," Surround a word with "quotes"
map ," ysiw"
vmap ," c"<C-R>""<ESC>
" ,' Surround a word with 'single quotes'
map ,' ysiw'
vmap ,' c'<C-R>"'<ESC>
" ,) or ,( Surround a word with (parens)
" The difference is in whether a space is put in
map ,( ysiw(
map ,) ysiw)
vmap ,( c( <C-R>" )<ESC>
vmap ,) c(<C-R>")<ESC>
" ,[ Surround a word with [brackets]
map ,] ysiw]
map ,[ ysiw[
vmap ,[ c[ <C-R>" ]<ESC>
vmap ,] c[<C-R>"]<ESC>
" ,{ Surround a word with {braces}
map ,} ysiw}
map ,{ ysiw{
vmap ,} c{ <C-R>" }<ESC>
vmap ,{ c{<C-R>"}<ESC>
" gary bernhardt's hashrocket
imap <c-l> <space>=><space>