normal·mode
~ / visual
6

Visual Mode

Select characters, lines or rectangular blocks first, then act. Includes block editing for columns of text.

  1. 01

    v, V and Ctrl-v: select, then act

    Highlight characters, whole lines or a rectangle, then press an operator.

    vV<C-v>dcUu<Esc>nvim
  2. 02

    Adjust a selection: o and gv

    Grow a selection from its other end, and bring back the last one.

    oOgvviw
  3. 03

    Repeat a Visual edit with .

    . replays the last Visual edit on the same amount of text at the cursor.

    .><{count}>nvim
  4. 04

    Operators repeat better than selections

    For edits you'll repeat, use operator + text object so . fits every spot.

    gU{motion}gu{motion}g~{motion}ci"nvim
  5. 05

    Edit a column: I, c and r on a block

    Type once and every selected line gets it: block insert, block change, replace.

    <C-v>{move}I{text}<Esc><C-v>{move}c{text}<Esc>r{char}yypVr=
  6. 06

    Append to ragged lines: $A

    Add the same text to the end of lines that all have different lengths.

    <C-v>{move}$A{text}<Esc><C-v>{move}A{text}<Esc>$
outside the editor the page is in normal mode: ? keymaps · / find · : commandsfound this useful? ☕ support it ·credits · source · not affiliated with Vim or Neovim