Vim / Neovim Visual Mode, Block Editing, Registers, and Marks

Select text precisely, edit columns, control registers, and jump back to saved positions.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all

Visual modes

Choose character, line, or block selections based on the task.

Characterwise visual mode

Select arbitrary text regions.

vimANYvimvisual-modeselection
vim
v

Best for local selections, replacements, and ad hoc edits.

Linewise visual mode

Select whole lines.

vimANYvimvisual-modelines
vim
V

Useful for moving, indenting, or commenting blocks.

Blockwise visual mode

Select a rectangular text block.

vimANYvimvisual-blockcolumns
vim
<C-v>

Excellent for column edits and multi-line inserts.

Reselect last visual selection

Bring back the last selected region.

vimANYvimvisual-modeselection
vim
gv

Very useful after indenting or replacing a prior selection.

Visual block editing

Do fast column-oriented edits with block selections.

Insert at start of block

Add text to the start of many lines at once.

vimANYvimvisual-blockinsert
vim
<C-v> ... Itext<Esc>

After pressing Esc, Vim applies the insert to each selected line.

Append at end of block

Add text to the end of many lines.

vimANYvimvisual-blockappend
vim
<C-v> ... Atext<Esc>

Useful for commas, semicolons, and aligned edits.

Replace a rectangular block

Overwrite a visual block with one character.

vimANYvimvisual-blockreplace
vim
<C-v> ... rX

Good for columnar status flags and tables.

Registers and marks

Control where text goes and bookmark meaningful positions.

Paste after or before cursor

Put text from the default register.

vimANYvimregisterspaste
vim
p  P

`p` pastes after; `P` pastes before.

Use a named register

Yank or paste from a named register.

vimANYvimregistersclipboard
vim
"ayy  "ap

Named registers are helpful when juggling multiple clips.

List register contents

Inspect available registers.

vimANYvimregistersinspect
vim
:registers

Useful while debugging macro, yank, and clipboard behavior.

Set and jump to a mark

Bookmark a file location and return later.

vimANYvimmarksnavigation
vim
ma  `a  'a

The mark name follows `m`; use backtick for exact position.

Recommended next

No recommendations yet.