2

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.)

3

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
  • 2
    Operator-pending mode may be worth mentioning – D. Ben Knoble Feb 24 '20 at 22:09
  • @D.BenKnoble done. – Herb Feb 25 '20 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.