Custom surround.vim ability to wrap #{ruby} variables using s# motion

This commit is contained in:
yan
2011-12-17 13:27:01 -08:00
committed by Yan Pritzker
parent f3a3ef7713
commit b125a96fb8
3 changed files with 51 additions and 18 deletions

View File

@@ -33,6 +33,9 @@ imap <silent> <D-D> -
" Don't have to use Shift to get into command mode, just hit semicolon
nnoremap ; :
"Go to last edit location with ,.
nnoremap ,. '.
" ================== rails.vim
"
" Open corresponding unittest (or spec), alias for :AV in rails.vim

View File

@@ -0,0 +1,12 @@
" via: http://whynotwiki.com/Vim
" Ruby
" Use v or # to get a variable interpolation (inside of a string)}
" ysiw# Wrap the token under the cursor in #{}
" v...s# Wrap the selection in #{}
let g:surround_113 = "#{\r}" " v
let g:surround_35 = "#{\r}" " #
" Select text in an ERb file with visual mode and then press s- or s=
" Or yss- to do entire line.
let g:surround_45 = "<% \r %>" " -
let g:surround_61 = "<%= \r %>" " =