How do I copy from the cursor to the end of the line?
y$
The y$ command yanks (copies) text from the cursor position to the end of the line.
19 results for "y motion"
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.
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
gl{motion}{char}
vim-lion (by Tom McDonald) adds gl and gL as alignment operators.
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.
: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.
: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.
:set operatorfunc=MyFunc<CR>g@
Vim lets you define custom operators that behave like built-in ones (d, c, y) — they wait for a motion or text object, then act on the selected region.
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
"{register}y{motion}
Vim has 26 named registers (a-z) that act as independent clipboards.
registers #registers #editing #normal-mode #yank #productivity
v
The v command enters character-wise visual mode, letting you select text one character at a time.
"+yy
The "+yy command yanks the current line directly to the system clipboard register, making it available for pasting in other applications.
cs'"
The vim-surround plugin (by Tim Pope) adds three powerful operators for working with surrounding delimiters — quotes, brackets, parentheses, and HTML tags.
<C-v>jj$A;
Visual block mode normally selects a fixed-width column, which makes appending tricky when lines have different lengths.
gn
The gn motion searches forward for the next match of the last search pattern and visually selects it.
search #navigation #search #motions #normal-mode #repeat #editing
v%
How it works The % motion jumps to the matching bracket, parenthesis, or brace.
"_d
The "d command deletes text using the black hole register ("), which discards the deleted content instead of storing it.
onoremap ih :<C-u>execute "normal! ?^==\+$\r:noh\rkvg_"<CR>
Vim lets you define custom text objects using operator-pending mode mappings (onoremap) and visual mode mappings (vnoremap).