Merge pull request #107 from DanielleSucher/support-arbitrary-delimiters
Handle arbitrary delimiters with cs and ds
This commit is contained in:
commit
9bf527af3a
@ -379,6 +379,12 @@ function! s:dosurround(...) " {{{1
|
|||||||
let strcount = (scount == 1 ? "" : scount)
|
let strcount = (scount == 1 ? "" : scount)
|
||||||
if char == '/'
|
if char == '/'
|
||||||
exe 'norm! '.strcount.'[/d'.strcount.']/'
|
exe 'norm! '.strcount.'[/d'.strcount.']/'
|
||||||
|
elseif char =~# '[[:punct:]]' && char !~# '[][(){}<>]'
|
||||||
|
exe 'norm! T'.char
|
||||||
|
if getline('.')[col('.')-1] == char
|
||||||
|
exe 'norm! l'
|
||||||
|
endif
|
||||||
|
exe 'norm! dt'.char
|
||||||
else
|
else
|
||||||
exe 'norm! d'.strcount.'i'.char
|
exe 'norm! d'.strcount.'i'.char
|
||||||
endif
|
endif
|
||||||
@ -403,6 +409,9 @@ function! s:dosurround(...) " {{{1
|
|||||||
norm! "_x
|
norm! "_x
|
||||||
call setreg('"','/**/',"c")
|
call setreg('"','/**/',"c")
|
||||||
let keeper = substitute(substitute(keeper,'^/\*\s\=','',''),'\s\=\*$','','')
|
let keeper = substitute(substitute(keeper,'^/\*\s\=','',''),'\s\=\*$','','')
|
||||||
|
elseif char =~# '[[:punct:]]' && char !~# '[][(){}<>]'
|
||||||
|
exe 'norm! F'.char
|
||||||
|
exe 'norm! df'.char
|
||||||
else
|
else
|
||||||
" One character backwards
|
" One character backwards
|
||||||
call search('.','bW')
|
call search('.','bW')
|
||||||
|
Loading…
Reference in New Issue
Block a user