How do I append text to the end of multiple lines that have different lengths?
<C-v>jj$A;
Visual block mode normally selects a fixed-width column, which makes appending tricky when lines have different lengths.
216 results for "= motion"
<C-v>jj$A;
Visual block mode normally selects a fixed-width column, which makes appending tricky when lines have different lengths.
zd
zd removes the fold definition at the cursor position — the text inside the fold is not deleted.
gwip
The gw operator reformats text just like gq, but leaves the cursor in its original position after reformatting.
=G
The =G command applies Vim's auto-indent operator (=) from the current line to the last line of the file (G).
<C-o>zvzz
Jumping backward with is fast, but in folded or dense files it can land you in a collapsed section or near the edge of the screen, forcing extra cleanup keystro
{N}@q
Prefix a macro invocation with a count to execute it up to N times in a single command.
:echo getregtype('a')
The getregtype() function returns the motion type of a register's content — whether it was yanked characterwise, linewise, or as a visual block.
dgn
The gn motion is a versatile text object that selects the next occurrence of the last search pattern.
editing #editing #search #text-objects #normal-mode #motions
:debug normal @q
Recorded macros are powerful, but when one keystroke goes wrong they can fail fast and leave confusing state behind.
packadd matchit
Vim ships with matchit.
iW vs iw
Vim has two flavors of the "inner word" text object that are easy to confuse: iw (lowercase) and iW (uppercase).
d3aw
Most Vim users know you can put a count before an operator (3dw) or use a text object once (daw).
editing #text-objects #editing #delete #normal-mode #motions
:let @a = @a[:-2]
Macros and named registers are just strings, so you can surgically edit them instead of re-recording from scratch.
qq{commands}@qq
A recursive macro calls itself at the end of its own definition, causing it to run repeatedly until Vim hits an error — such as reaching the end of the file o
:'<,'>s/pattern/replacement/g
When you make a visual selection and then type :, Vim automatically inserts ' as the range — the marks for the start and end of the last visual selection.
g; and g,
Vim tracks every position where you made a change in the changelist.
:set nostartofline
By default, many Vim movement commands — gg, G, Ctrl-d, Ctrl-u, Ctrl-f, Ctrl-b, and others — snap the cursor to the first non-blank character of the destina
42G
The 42G command jumps the cursor directly to line 42 in the current file.
mA and 'A
Vim has two tiers of marks.
q?
Vim provides three command-line history windows accessible from normal mode: q: for Ex commands, q/ for forward searches, and q? for backward searches.