Registers (Multi-Clipboard)
Store yanks/deletes in named registers and paste from them.
Code
:reg " show all registers
"ayy " yank current line into register a
"ap " paste from register a
"+yy " yank line to system clipboard (+)
"*p " paste from system selection (*)
" " the unnamed register (last yank/delete)
0 " register 0: last yank
1-9 " numbered: last deletes (1 = most recent)
. " last inserted text
% " current file name
/ " last search pattern
" Clear a register: yank into it, or set to empty
:let @a = ""
" Append to a register with uppercase
"Ayy " append current line to register aExplanation
Registers are Vim's multiple clipboards. " is the unnamed register (filled by every yank/delete). a–z are named (use "a before an operator like y/d to target it); A–z append. 0 holds the last yank, 1–9 hold recent deletes. + is the system clipboard (requires +clipboard build); * is the X primary selection. :reg lists everything. To paste, type "ap (register name then p/P). Macros are stored in registers too, so "ayy then "ap is also how you'd inspect a macro.
More Vim Snippets
Buffers, Windows & Tabs
Edit multiple files with buffers, split windows, and tab pages.
Search & Substitute
Find text with / and replace with :s, leveraging regex and ranges.
Marks (Bookmarks)
Jump back to positions in a file or across files with marks.
Macros (Recorded Keystrokes)
Record a sequence of keys and replay it to automate repetitive edits.
Folding (Collapse Code)
Hide regions of code to focus on structure with fold methods.
Plugin Managers & Ecosystem
Install, configure and discover plugins with vim-plug / packer / lazy.