How do I display the contents of only certain registers instead of all of them at once?
Answer
:reg a b c
Explanation
The :reg (alias :registers) command accepts a string of register names as its argument. Passing one or more names shows only those registers, making it easy to compare a few specific values without scrolling through all 48+ registers that :reg alone would display.
How it works
:regwith no arguments lists every register that has content:reg {chars}displays only the registers whose names appear in{chars}- The argument is a string of names, not space-separated:
:reg abshowsaandb;:reg a b cdoes the same (spaces are ignored) - Works with named registers (
a–z), numbered registers (0–9), and special registers (",+,*,-, etc.)
Example
After recording a macro into q and yanking text into a:
:reg qa"
Shows only registers q, a, and " (the default register):
--- Registers ---
"q dd0^M
"a some yanked text
"" last deleted/changed text
Tips
:reg 0shows the yank register — the most recently yanked text, unaffected by deletes:reg 0"shows the yank register alongside the default register — useful to confirm a yank before pasting:reg +*shows both clipboard registers on systems with clipboard support:reg 123456789shows the numbered delete history registers in order- In insert mode,
<C-r>apastes from registeradirectly