mirror of
https://github.com/tpope/vim-surround.git
synced 2025-12-09 06:04:45 +08:00
Discard numerical argument for ys and yS
This commit is contained in:
@@ -691,10 +691,11 @@ endfunction " }}}1
|
|||||||
|
|
||||||
nnoremap <silent> <Plug>Dsurround :<C-U>call <SID>dosurround(<SID>inputtarget())<CR>
|
nnoremap <silent> <Plug>Dsurround :<C-U>call <SID>dosurround(<SID>inputtarget())<CR>
|
||||||
nnoremap <silent> <Plug>Csurround :<C-U>call <SID>changesurround()<CR>
|
nnoremap <silent> <Plug>Csurround :<C-U>call <SID>changesurround()<CR>
|
||||||
nnoremap <silent> <Plug>Ysurround :set opfunc=<SID>opfunc<CR>g@
|
|
||||||
nnoremap <silent> <Plug>YSurround :set opfunc=<SID>opfunc2<CR>g@
|
|
||||||
nnoremap <silent> <Plug>Yssurround :<C-U>call <SID>opfunc(v:count1)<CR>
|
nnoremap <silent> <Plug>Yssurround :<C-U>call <SID>opfunc(v:count1)<CR>
|
||||||
nnoremap <silent> <Plug>YSsurround :<C-U>call <SID>opfunc2(v:count1)<CR>
|
nnoremap <silent> <Plug>YSsurround :<C-U>call <SID>opfunc2(v:count1)<CR>
|
||||||
|
" <C-U> discards the numerical argument but there's not much we can do with it
|
||||||
|
nnoremap <silent> <Plug>Ysurround :<C-U>set opfunc=<SID>opfunc<CR>g@
|
||||||
|
nnoremap <silent> <Plug>YSurround :<C-U>set opfunc=<SID>opfunc2<CR>g@
|
||||||
vnoremap <silent> <Plug>Vsurround :<C-U>call <SID>opfunc(visualmode())<CR>
|
vnoremap <silent> <Plug>Vsurround :<C-U>call <SID>opfunc(visualmode())<CR>
|
||||||
vnoremap <silent> <Plug>VSurround :<C-U>call <SID>opfunc2(visualmode())<CR>
|
vnoremap <silent> <Plug>VSurround :<C-U>call <SID>opfunc2(visualmode())<CR>
|
||||||
inoremap <silent> <Plug>Isurround <C-R>=<SID>insert()<CR>
|
inoremap <silent> <Plug>Isurround <C-R>=<SID>insert()<CR>
|
||||||
@@ -714,7 +715,7 @@ if !exists("g:surround_no_mappings") || ! g:surround_no_mappings
|
|||||||
if !hasmapto("<Plug>VSurround","v")
|
if !hasmapto("<Plug>VSurround","v")
|
||||||
vmap S <Plug>VSurround
|
vmap S <Plug>VSurround
|
||||||
endif
|
endif
|
||||||
if !hasmapto("<Plug>Isurround","i")
|
if !hasmapto("<Plug>Isurround","i") && !mapcheck("<C-S>","i")
|
||||||
imap <C-S> <Plug>Isurround
|
imap <C-S> <Plug>Isurround
|
||||||
endif
|
endif
|
||||||
"Implemented internally instead
|
"Implemented internally instead
|
||||||
|
|||||||
Reference in New Issue
Block a user