Posts

overwrite motion-wiseness of operator pending mode

Image
Clash Royale CLAN TAG #URR8PPP up vote 2 down vote favorite Background In :h motion.txt , it says: FORCING A MOTION TO BE LINEWISE, CHARACTERWISE OR BLOCKWISE When a motion is not of the type you would like to use, you can force another type by using "v", "V" or CTRL-V just after the operator. Example: > dj deletes two lines > dvj deletes from the cursor position until the character below the cursor > d<C-V>j deletes the character under the cursor and the character below the cursor. > In :h omap-info To ignore the starting cursor position and select different text, you can have the omap start Visual mode to select the text to be operated upon. Example that operates on a function name in the current line: > onoremap <silent> F :<C-U>normal! 0f(hviw<CR> In :h movement for what can be used as a motion - Ex commands can be used to move the cursor. This can be used to call a function that does some complicated mo...