Vim - Modes - Visual


Visual mode allows you to select text. To enter, press v.

Useful things to do in visual mode:

  • y: Copy selected text to vim's clipboard
  • d: Delete selected text and copy to vim's clipboard
  • c: Delete selected text and enter insert mode
  • < or >: Increase or decrease indentation of selected lines
  • :s/FIND/REPLACE/g: Find and replace text on selected LINES (including non-selected part)

There is also visual block mode.

Useful things to do in visual block mode:

  • Shift + i: Insert text on multiple lines. Type text then hit Esc.