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

@@ -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>