diff --git a/plugin/surround.vim b/plugin/surround.vim index 846e838..c80847e 100644 --- a/plugin/surround.vim +++ b/plugin/surround.vim @@ -509,6 +509,8 @@ function! s:opfunc(type,...) " {{{1 let &clipboard = cb_save if a:type =~ '^\d\+$' silent! call repeat#set("\Y".(a:0 && a:1 ? "S" : "s")."surround".char.s:tag,a:type) + else + silent! call repeat#set("\Yrepeat".char.s:tag,a:type) endif endfunction @@ -539,6 +541,7 @@ nnoremap YSsurround :call opfunc2(v:count1) " discards the numerical argument but there's not much we can do with it nnoremap Ysurround :set opfunc=opfuncg@ nnoremap YSurround :set opfunc=opfunc2g@ +nnoremap Yrepeat :execute 'normal! .'.inputtarget() vnoremap VSurround :call opfunc(visualmode(),visualmode() ==# 'V' ? 1 : 0) vnoremap VgSurround :call opfunc(visualmode(),visualmode() ==# 'V' ? 0 : 1) inoremap Isurround =insert()