I have a function that takes a string of commands to execute and ensures that 'paste' enabled before running them. What I'm looking for is like the following:
vmap <silent> <CK> :<CU>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
but the "<Plug>ReplaceVisual" should run in Visual mode, and not in normal mode.
Is there a command like :normal that launches keystrokes in visual mode?
Peeja source share