我有一个函数,它执行一系列命令,并确保'paste'
在运行它们之前打开.我正在寻找的是类似于以下内容:
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
Run Code Online (Sandbox Code Playgroud)
但是命令"<Plug>ReplaceVisual"
需要在可视模式下运行,而不是在普通模式下运行.
是否有一个命令:normal
在Visual模式下运行击键?