How do I autocomplete macro-defined identifiers from header files while in insert mode?
in insert mode triggers defined identifier completion — it searches for identifiers that match the partial word before the cursor by scanning #define statemen
category:
editing
tags:
#editing
#insert-mode
#completion
How do I paste register contents at the beginning of a file without moving the cursor there first?
The :put Ex command inserts register contents as a new line below the specified line number.
category:
editing
tags:
#editing
#ex-commands
#registers
#normal-mode
How do I quickly append text to the end of a word under the cursor in Vim?
The ea compound shortcut moves to the last character of the current word with e, then enters insert mode after the cursor with a.
category:
editing
tags:
#editing
#motions
#insert-mode
#normal-mode
How do I uppercase or lowercase the entire current line in one keystroke?
The gUU command uppercases every character on the current line instantly — no visual selection or motion required.
category:
editing
tags:
#editing
#normal-mode
#formatting
How do I join all lines in a file into one, or use a custom separator when joining?
Using \n in the pattern of :substitute matches the newline character at the end of each line, letting you join lines with any separator you choose — something
category:
editing
tags:
#editing
#ex-commands
#search
#formatting
How do I make the gq operator format code with an external tool like prettier or black?
When formatprg is set, the gq operator pipes the selected text through that external program and replaces it with the program's output.
category:
editing
tags:
#editing
#formatting
#ex-commands
#config
How do I select or operate on the content of an HTML or XML tag using text objects?
Vim provides two built-in text objects for HTML and XML tags: it (inner tag) and at (a tag).
category:
editing
tags:
#text-objects
#editing
#visual-mode
#html
#normal-mode
How does Ctrl+C differ from Escape when exiting insert mode, and why does it matter?
exits insert mode immediately but silently skips two important side effects that (and its equivalent ) always trigger: abbreviation expansion and InsertLeave au
category:
editing
tags:
#insert-mode
#normal-mode
#editing
#autocmds
How do I open just enough folds to see the current line without expanding everything?
zv (view cursor) opens the minimum number of folds needed to make the current line visible — nothing more.
category:
editing
tags:
#folding
#navigation
#editing
How do I apply the last spelling correction to all other identical misspellings in the file?
After correcting a misspelled word with z= (or 1z= for the first suggestion), run :spellrepall to apply that same correction to every other occurrence of the id
category:
editing
tags:
#editing
#search
How do I delete everything typed on the current line without leaving insert mode?
Pressing while in insert mode deletes all characters entered since you last entered insert mode on the current line.
category:
editing
tags:
#insert-mode
#editing
#delete
#normal-mode
How do I reformat a paragraph or motion to fit within the text width without moving my cursor?
The gw operator reformats text to fit within textwidth, just like gq — but with one key difference: gw leaves the cursor in its original position after format
category:
editing
tags:
#editing
#formatting
#text-objects
#normal-mode
How do I run a normal mode command on multiple lines at once?
The :normal Ex command lets you execute any Normal mode keystrokes on a range of lines simultaneously, turning a single-line operation into a multi-line batch e
category:
editing
tags:
#editing
#normal-mode
#ex-commands
#visual-mode
#text-manipulation
How do I quit Vim without saving using a two-keystroke normal mode shortcut?
ZQ is the discard-and-quit counterpart to ZZ.
category:
editing
tags:
#editing
#normal-mode
#ex-commands
How do I join a specific number of lines at once without pressing J multiple times?
The J command joins the current line with the line below, adding a space between them.
category:
editing
tags:
#editing
#normal-mode
#join
#motions
How do I create a fold that spans the current paragraph in manual fold mode?
Combining the fold-creation operator zf with the ap (around paragraph) text object gives you a quick way to collapse any paragraph into a single fold line.
category:
editing
tags:
#folding
#text-objects
#normal-mode
#editing
How do I re-insert the text from my last insert session and immediately return to normal mode?
Pressing (Ctrl + @, which is the NUL character) in insert mode inserts the same text that was typed during the most recent insert session, then immediately retu
category:
editing
tags:
#insert-mode
#editing
#undo-redo
How do I autocomplete Vim command names and their arguments while in insert mode?
The key sequence in insert mode triggers Vim command-line completion — the same completion engine used at the : command prompt.
category:
editing
tags:
#insert-mode
#completion
#editing
#command-line
How do I center or right-align lines of text using Vim's built-in Ex commands?
Vim has three built-in Ex formatting commands — :left, :center, and :right — that align text within a specified column width.
category:
editing
tags:
#editing
#formatting
#ex-commands
#text
How do I paste the contents of a register as a new line below the cursor regardless of the register type in Vim?
The :put Ex command always inserts a register's content as a new line below the current line, regardless of whether the register holds characterwise, linewise,
category:
editing
tags:
#registers
#editing
#paste
#ex-commands
#normal-mode