How do you yank an entire paragraph into a named register?
"ayip
Use "ayip to yank the inner paragraph into register a.
Search Vim Tricks
Searching..."ayip
Use "ayip to yank the inner paragraph into register a.
"ayis
Use "ayis to yank the inner sentence into register a.
<C-v>jjll"ay
Enter visual block mode with , select the block, then "ay to yank the block into register a.
gg"aVGy
Go to the first line with gg, then visually select from there to the last line with VG, and yank into register a.
"aVaBy
Position cursor in a function, use VaB to visually select the block including braces, then "ay to yank into register a.
qa"bpq
While recording macro a, paste from register b with "bp.
:%s/<C-r>a/replacement/g
In command-line mode, a inserts the contents of register a.
""p
The unnamed register "" is the default target for yank, delete, and change operations.
:let @/ = 'pattern'
Use :let @/ = 'pattern' to set the search register directly.
"*p
The register represents the primary selection (middle-click paste in X11).
:call setreg('a', 'text')
Use setreg() to set register contents from Vimscript.
"_dP or use "0p
When pasting over a selection, the replaced text overwrites the unnamed register.
:put a
The :put a command pastes register a on a new line below the cursor.
%. # :
Vim has read-only registers: % (current filename), # (alternate filename), .
qa...q
Press q followed by a lowercase letter (a-z) to start recording into that register.
"ap
In visual mode, "ap replaces the selected text with the contents of register a.
5"ap
Prefix the paste command with a count.
"aP
Use "aP (uppercase P) to paste the contents of register a before the cursor position, as opposed to "ap which pastes after.
:call setreg('a', @a, 'v') then "ap
Use setreg() to change register a to characterwise mode (v), then paste.
/<C-r>a
While in the search prompt (/), press a to insert the contents of register a.