How to support count argument in a custom VIM text object? -
i have custom text object defined function:
onoremap <buffer> <silent> <leader>m :<c-u>call myfunction()<cr> " myfunction() selects text in visual mode
simple text operations d<leader>m
work well. there way make work count argument (e.g. d5<leader>m
)? expected result calling myfunction()
5 times, , deleting selected text.
after referring these instructions came below snippet should problem:
function! hello() normal ihello, world^m^[ endfunction map <f7> @=':call hello()<c-v><cr>'<cr>
pressing f7
insert "hello, world\n" @ cursor location. 2f7
insert "hello, world\nhello,world\n" , on.
Comments
Post a Comment