If I'm in command mode with default vim and I press the right angle key, the cursor switches from the normal block to a short version. What is the function of this? (Sometimes it seems related to indent.)
1 Answer
The angled brackets <
and >
are the shift commands.
The reason it's a short block is that vim enters operator-pending-mode, and is waiting for you to complete the command. >>
is used to shift the current line by one shiftwidth
right, and <<
is used to shift the current line one shiftwidth
left. The brackets can also be followed by a motion command to shift multiple lines or blocks.
From vim's help file:
operator-pending-mode is like normal mode, but after an operator command has started, and Vim is waiting for a {motion} to specify the text that the operator will work on.
For more information, read :help shift-left-right
and the Vim wiki page on shifting blocks visually.
-
2
-