When declaring a mapping with omap
or onoremap
i would like to be able to handle the case where the motion will be blockwise, linewise or standard.
For example let's consider the following block:
abcd
efgh
ijkl
mnop
Cursor is on the letter f. Suppose that I define an operator map from K
to :normal! vjl
(go to letter k).
onoremap K :normal! vjl<cr>
Interestingly enough when I run dvK
, dK
, d^VK
I get respectively
abcd abcd abcd
el el eh
mnop mnop il
mnop
But when I run dVK
it won't work, I get exactly the same as with dvK
.
I tried to use visualmode()
(mapping defined as @=visualmode()<cr>jl<cr>
but this does not work. It seems that the return value of this function is not immediately affected when you use v
, V
or CTRL-V in operator-pending mode.
Does anyone have a clue please?
Thank you