How do I merge changes between two diff windows using diffget and diffput?
do (diffget) / dp (diffput)
How it works When you open two files in diff mode (using vim -d file1 file2 or :windo diffthis), Vim highlights the differences between them.
do (diffget) / dp (diffput)
How it works When you open two files in diff mode (using vim -d file1 file2 or :windo diffthis), Vim highlights the differences between them.
qa0f:dwj0q
How it works When recording a macro that you plan to repeat across multiple lines, the key technique is to end the macro positioned on the next line, ready for
<C-w>}
How it works The } command opens a preview window showing the tag definition of the word under your cursor.
qaq
How it works To clear a macro register, you simply start recording into that register and immediately stop.
<C-w>f
How it works You may already know that gf opens the file path under the cursor in the current window.
<C-w>x
How it works The x command exchanges the current window with the next one.
<C-w>h / <C-w>j / <C-w>k / <C-w>l
How it works Vim lets you navigate between split windows using followed by a direction key.
@@
How it works After running a macro with @a (or any other register), you can repeat that same macro by pressing @@.
"-p
The small delete register ("-) captures text from delete operations that are less than one line — like dw, x, dt.
{N}|
The command (pipe character) moves the cursor to a specific column number on the current line.
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
ggVG
While Vim doesn't have a built-in "entire buffer" text object, the ggVG sequence achieves it: go to the first line, enter line-wise visual mode, then select to
zt / zb
The zt and zb commands scroll the viewport so the current cursor line appears at the top or bottom of the screen respectively, without moving the cursor.
gx
The gx command opens the URL, file path, or identifier under the cursor using the system's default handler.
navigation #navigation #netrw #workflow #browser #normal-mode
gj / gk
When a long line wraps across multiple screen rows, the regular j and k motions skip the entire logical line.
gJ
The gJ command joins the current line with the line below it without inserting any space between them.
<C-a> / <C-x>
Pressing increments and decrements the number under or after the cursor.
ga
The ga command displays the ASCII/Unicode value of the character under the cursor in decimal, hexadecimal, and octal.
editing #editing #unicode #debugging #normal-mode #inspection
:'<,'>normal A;
The :normal command executes normal-mode keystrokes on every line in a range.
command-line #command-line #ex-commands #editing #normal-mode #batch-editing
ci" / ci( / ci{ / ci[ / ci` / ci'
The ci{delimiter} family of commands changes the text inside any matching pair of delimiters.
editing #editing #text-objects #change #delimiters #normal-mode