How do I increment and decrement dates, times, and other structured sequences in Vim?
<C-a> / <C-x> (vim-speeddating)
vim-speeddating (by Tim Pope) extends Vim's built-in and increment/decrement operators to understand dates, times, roman numerals, and other ordered sequences.
category:
plugins
tags:
#plugins
#editing
#normal-mode
How do I apply a macro to every line in a specific range without running it manually each time?
The :[range]normal @q command replays the macro in register q on every line within a given range.
category:
macros
tags:
#macros
#normal-mode
#ex-commands
#ranges
How do I filter buffer contents through an external shell command?
The :%!{cmd} command pipes the entire buffer through an external shell command and replaces the buffer contents with the command's output.
category:
command-line
tags:
#editing
#ex-commands
#shell
#filtering
#productivity
How do I reformat a paragraph to fit a specific line width?
The gqip command reformats the current paragraph to fit within the configured textwidth.
category:
editing
tags:
#editing
#formatting
#text-objects
#normal-mode
How do I highlight trailing whitespace with a custom color in Vim?
highlight TrailingWhitespace ctermbg=red and match TrailingWhitespace /\s\+$/
How it works Vim's highlight and match commands let you create custom visual indicators.
category:
config
tags:
#editing
#formatting
#search
How do I jump between sentences in Vim?
How it works Vim defines a sentence as text ending with .
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I paste the result of a calculation or expression in normal mode?
The expression register ("=) lets you evaluate any Vimscript expression and paste the result directly into your buffer from normal mode.
category:
registers
tags:
#registers
#editing
#normal-mode
#productivity
#math
How do I copy text to the system clipboard in Vim?
The "+y command yanks (copies) text into the system clipboard register, making it available to paste in other applications outside of Vim.
category:
registers
tags:
#registers
#yank
#editing
#normal-mode
How do I insert the output of a shell command into my file?
The :r !command command executes a shell command and inserts its output directly into the current buffer below the cursor line.
category:
command-line
tags:
#command-line
#ex-commands
#editing
How do I run a shell command from inside Vim?
The :!command syntax lets you execute any shell command directly from within Vim without leaving the editor.
category:
command-line
tags:
#command-line
#ex-commands
#editing
How do I replay a macro multiple times in Vim?
The 10@a command replays the macro recorded in register a exactly 10 times.
category:
macros
tags:
#macros
#normal-mode
#editing
How do I run an interactive git blame inside Vim?
The vim-fugitive plugin by Tim Pope provides a powerful interactive :Git blame that goes far beyond the basic command-line git blame.
category:
plugins
tags:
#plugins
#fugitive
#git
#blame
#history
How do I execute the current line as a shell command and insert the output?
The :.
category:
command-line
tags:
#editing
#ex-commands
#shell
#filtering
#productivity
How do I view a side-by-side Git diff of staged changes inside Vim?
The vim-fugitive plugin provides :Gdiffsplit (and its vertical variant :Gvdiffsplit) to open a side-by-side diff view comparing the working tree version of a fi
category:
plugins
tags:
#plugins
#fugitive
#git
#diff
#staging
How do I quickly comment and uncomment code in Vim with a plugin?
The vim-commentary plugin by Tim Pope provides a minimal yet powerful way to toggle comments in any programming language.
category:
plugins
tags:
#plugins
#commentary
#commenting
#editing
#normal-mode
How do I use a macro to generate a numbered list automatically?
By recording a macro that duplicates a line and increments its number, you can generate a numbered list of any length with a single replay command.
category:
macros
tags:
#macros
#editing
#normal-mode
#automation
#productivity
How do I navigate undo branches to recover changes that were overwritten by a new edit?
Vim doesn't have a simple linear undo stack — it maintains a full undo tree with branches.
category:
editing
tags:
#editing
#undo-redo
#normal-mode
#advanced
#productivity
How do I rapidly generate HTML boilerplate using abbreviations in Vim?
The emmet-vim plugin brings the full power of Emmet (formerly Zen Coding) to Vim, letting you type a short CSS-like abbreviation and expand it into a complete H
category:
plugins
tags:
#plugins
#emmet
#html
#css
#editing
#insert-mode
How do I quickly toggle options and navigate lists using bracket mappings in Vim?
The vim-unimpaired plugin by Tim Pope provides a consistent set of bracket-based mappings for toggling Vim options, navigating paired lists, and performing comm
category:
plugins
tags:
#plugins
#unimpaired
#navigation
#options
#workflow
How do I fold and unfold sections of code to hide details I'm not working on?
Vim's folding system lets you collapse blocks of code into a single line, hiding the details so you can focus on the structure.
category:
editing
tags:
#editing
#folding
#navigation
#normal-mode
#productivity