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
Notes

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

Linewise visual mode

Select whole lines.

vimANYvimvisual-modelines
vim
V
Notes

Useful for moving, indenting, or commenting blocks.

Blockwise visual mode

Select a rectangular text block.

vimANYvimvisual-blockcolumns
vim
<C-v>
Notes

Excellent for column edits and multi-line inserts.

Reselect last visual selection

Bring back the last selected region.

vimANYvimvisual-modeselection
vim
gv
Notes

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>
Notes

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>
Notes

Useful for commas, semicolons, and aligned edits.

Replace a rectangular block

Overwrite a visual block with one character.

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

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
Notes

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

Use a named register

Yank or paste from a named register.

vimANYvimregistersclipboard
vim
"ayy  "ap
Notes

Named registers are helpful when juggling multiple clips.

List register contents

Inspect available registers.

vimANYvimregistersinspect
vim
:registers
Notes

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
Notes

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

Recommended next

No recommendations yet.