How do I yank text into a specific named register for later use?
"{register}y{motion}
Vim has 26 named registers (a-z) that act as independent clipboards.
registers #registers #editing #normal-mode #yank #productivity
43 results for "y motion"
"{register}y{motion}
Vim has 26 named registers (a-z) that act as independent clipboards.
registers #registers #editing #normal-mode #yank #productivity
y/{pattern}<CR>
Any operator in Vim can take a search motion as its argument.
dv{motion}
In operator-pending mode — after typing an operator like d, y, or c but before the motion — you can press v, V, or to override the motion type to characterw
y$
The y$ command yanks (copies) text from the cursor position to the end of the line.
"+y
The "+y command yanks (copies) text into the system clipboard register, making it available to paste in other applications outside of Vim.
gU{motion} / gu{motion} / g~{motion}
Vim has three case operators that work with any motion or text object: gU for uppercase, gu for lowercase, and g~ for toggle case.
editing #editing #case #operators #text-objects #normal-mode
d<C-v>2j
Vim lets you override the natural type of any motion by pressing v, V, or between the operator and the motion.
editing #editing #motions #visual-mode #advanced #normal-mode
*NgUgn
gn is often treated as a visual selection command, but it is more powerful when used as a motion target for operators.
!{motion}sort
The ! operator in Vim filters a motion's text through an external shell command, replacing it with the output.
dV{motion}
In operator-pending mode — the brief state after typing an operator like d, c, or y but before entering the motion — you can prefix the motion with v, V, or
!{motion} {cmd}
The ! operator passes text selected by a motion through an external shell command, replacing it with the command's output.
:set operatorfunc=MyFunc<CR>g@{motion}
Vim's operatorfunc and g@ let you define custom operators that accept any motion or text object, just like built-in operators d, c, and y.
gl{motion}{char}
vim-lion (by Tom McDonald) adds gl and gL as alignment operators.
!{motion}{cmd}
The ! operator in normal mode lets you pipe any motion's text through a shell command and replace it with the output.
editing #editing #shell #external-command #normal-mode #filtering
:set opfunc and g@
Vim's operatorfunc option lets you define your own operators — just like the built-in d, y, or c — that accept any motion or text object.
d'a
Named marks are not just jump destinations — they serve as motion targets for any operator.
navigation #navigation #marks #editing #motions #normal-mode
:set tildeop
By default, ~ toggles the case of a single character and advances the cursor.
"*
On X11 Linux systems, there are two independent clipboard-like buffers: the primary selection (") and the clipboard ("+).
qqqqqq{edits}@qq
A recursive macro calls itself at the end of its sequence, creating a loop that automatically repeats until a motion or command fails (such as hitting the last
:[{,]}s/old/new/g
By using the range [{,]}, you can limit a substitute command to the lines between the enclosing braces — effectively the current function or block.