Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement csf and dsf #309

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion plugin/surround.vim
Expand Up @@ -406,6 +406,8 @@ function! s:dosurround(...) " {{{1
exe 'norm! l'
endif
exe 'norm! dt'.char
elseif char == 'f'
exe 'norm! d'.strcount.'i('
else
exe 'norm! d'.strcount.'i'.char
endif
Expand Down Expand Up @@ -436,7 +438,14 @@ function! s:dosurround(...) " {{{1
else
" One character backwards
call search('\m.', 'bW')
exe "norm! da".char
if char == "f"
exe "norm! da("
exe "norm! bdw"
" will put the deleted function name into the unnamed reg
let original = getreg('"')
else
exe "norm! da".char
endif
endif
let removed = getreg('"')
let rem2 = substitute(removed,'\n.*','','')
Expand Down