How do I paste the last Ex command I ran into my buffer?
":p
The : register holds the most recently executed Ex command.
registers #registers #ex-commands #normal-mode #productivity
":p
The : register holds the most recently executed Ex command.
registers #registers #ex-commands #normal-mode #productivity
".p
The ".
registers #registers #editing #insert-mode #normal-mode #productivity
<C-r>{register}
Pressing followed by a register name in insert mode inserts the contents of that register at the cursor position without leaving insert mode.
"1p then u.u.u.
Vim stores your last 9 deletions (of one line or more) in the numbered registers "1 through "9.
registers #registers #editing #normal-mode #undo-redo #paste
<C-r>=
The expression register (=) lets you evaluate Vimscript expressions on the fly and insert the result directly into your text.
registers #editing #insert-mode #registers #productivity #math
"=expression<CR>p
The expression register ("=) lets you evaluate any Vimscript expression and paste the result directly into your buffer from normal mode.
registers #registers #editing #normal-mode #productivity #math
qA
If you finish recording a macro and realize you forgot a step, you don't need to re-record the whole thing.
macros #macros #registers #normal-mode #editing #productivity
:g/pattern/yank A
The :g command combined with yank A (uppercase A to append) lets you collect every line matching a pattern into a single register without overwriting previous c
command-line #editing #ex-commands #global-command #registers #filtering
:registers
The :registers command displays the contents of all Vim registers, showing you exactly what text is stored in each one.
yy
The yy command yanks (copies) the entire current line, including the newline character.
"+y
The "+y command yanks (copies) text into the system clipboard register, making it available to paste in other applications outside of Vim.
P
The P (uppercase) command pastes the contents of the default register before the cursor position.
p
The p command pastes (puts) the contents of the default register after the cursor.
"+p
The "+p command pastes the contents of the system clipboard into Vim.
"ap, edit, "ayy
Vim stores macros in registers, which means you can paste a macro's contents into a buffer, edit it as regular text, and yank it back into the register.
"_d
The "d command deletes text using the black hole register ("), which discards the deleted content instead of storing it.
"Ayy
The "Ayy command appends the current line to register a instead of overwriting it.
"ayy ... "ap
Named registers let you store multiple pieces of text independently.
qa ... q ... @a
Macros let you record a sequence of commands and replay them.