4
我有一个函数需要一串命令来执行,并确保'paste'
在运行之前处于打开状态。我正在寻找的是类似于如下:如何从Vim函数执行Visual模式命令?
vmap <silent> <C-K> :<C-U>call InPasteMode("<Plug>ReplaceVisual")<CR>
function! InPasteMode(command)
let oldpaste = &l:paste
try
set paste
execute "normal" a:command
finally
let &l:paste = oldpaste
endtry
endfunction
但该命令,"<Plug>ReplaceVisual"
,需要在Visual模式,而不是正常模式下运行。
是否有像:normal
这样的命令在Visual模式下运行按键?
+1,我不知道'gv'。 – 2011-02-22 22:35:48