Kurt Keller's Blog

tech notes and more

visual selection

Selecting text in vim in a terminal window without mouse support may be a bit difficult if it’s not something like 3 words or 2 lines. Visual mode to the rescue! With visual mode your selection is not only highlighted, but you can also select arbitrary parts of the text file.

  1. go to the start of your selection
  2. type v
  3. move to the end of the selection with the usual motion commands
  4. type the command you want to perform on the selected text (like y for yank, d for delete, etc.)



There are three different selection modes:

v start visual selection in character mode
V start visual selection in line mode
CTRL-v start visual selection in block mode
Share

Leave a Reply