Added support to surround Ruby Blocks

Use 'R' or '<C-R>' to trigger addition of a ruby block around the
selected object either in visual mode or while using with ys commands.

TODO: Need to add support to allow deletion (via ds) of a ruby block.
This commit is contained in:
Dhruva Sagar 2013-03-05 18:01:17 +05:30
parent 02199ea008
commit a208a6e669

View file

@ -224,6 +224,12 @@ function! s:wrap(string,char,type,...)
let after = ' ' . after
endif
endif
elseif newchar ==# "R" || newchar == "\<C-R>"
let blk = input('block: ')
if blk != ""
let before = blk . "\n\t"
let after = "\nend"
endif
elseif newchar ==# "\<C-F>"
let fnc = input('function: ')
let before = '('.fnc.' '