vim shortcut for keyboard combo and a function call -
i have vim function (written else) runs highlighted visual block script in program. have keybinding (f9
) can call visual block of lines.
i further automatize things creating specific shortcuts 2 tasks:
- visually select here beginning of document , call function.
- visually select current line , call function.
i don't need use macro, tried use macros this. added
:let @r='0vgg<f9>'
to .vimrc
first task. , when try run it, seems highlight right area, function call never happens.
how suggest create these shortcuts successfully?
thanks
you should take function, if supports range
. if true, don't have visual selection. could:
nnoremap <f7> :1,.call yourfunction()<cr> nnoremap <f8> :.call yourfunction()<cr>
so, <f7>
call function range line1 till current line. <f8>
call function on current line.
if want define macro, have escape <f9>
:
:let @r="0vgg\<f9>"
otherwise, vim thinks pressed < f 9 , >
Comments
Post a Comment