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 jump back to where I last inserted text and continue typing?
The gi command moves the cursor to the position where you last exited insert mode and immediately enters insert mode again.
category:
navigation
tags:
#navigation
#insert-mode
#marks
#normal-mode
#productivity
How do I browse and manage files using Vim's built-in file explorer?
:Explore / :Vexplore / :Sexplore
Vim ships with netrw, a built-in file explorer that lets you browse directories, open files, create new files, rename, and delete — all without plugins.
category:
buffers-windows
tags:
#navigation
#buffers
#file-management
#netrw
#productivity
How do I quickly surround a word with quotes, brackets, or parentheses?
Vim doesn't have a built-in "surround" operator, but you can wrap any word in quotes or brackets with a short sequence: ciw""P.
category:
editing
tags:
#editing
#text-objects
#normal-mode
#productivity
#surround
How do I list all open buffers in Vim?
The :ls command displays a list of all open buffers in Vim, showing their buffer number, status indicators, file name, and the line the cursor was last on.
category:
buffers-windows
tags:
#buffers
#ex-commands
#navigation
How do I complete identifiers using ctags from within insert mode?
Pressing in insert mode opens a completion menu populated from your project's tags file.
category:
editing
tags:
#completion
#insert-mode
#editing
How do I reset the jump list to start fresh in the current window?
The :clearjumps command wipes the jump list for the current window, giving you a clean slate for and navigation.
category:
navigation
tags:
#navigation
#jumps
#jump-list
#normal-mode
How do I control which actions automatically open folds in Vim?
The foldopen option lets you specify exactly which cursor movements and commands will automatically open a closed fold.
category:
config
tags:
#folding
#config
#ex-commands
How do I append another pattern search to the current quickfix results?
:vimgrepadd /FIXME/j **/*.go
When you are triaging a codebase, one pattern is rarely enough.
category:
search
tags:
#search
#quickfix
#project-workflow
#ex-commands
How do I fuzzy search inside file contents across a project in Vim?
The fzf.
category:
plugins
tags:
#plugins
#fzf
#ripgrep
#search
#workflow
#quickfix
How do I select to the end of each line in visual block mode?
In visual block mode, pressing $ extends the selection to the end of every line, even when lines have different lengths.
category:
visual-mode
tags:
#visual-mode
#editing
#normal-mode
How do I insert the output of any Vim Ex command directly into the current buffer?
The :put =execute('{cmd}') idiom inserts the output of any Vim Ex command as text in your buffer.
category:
registers
tags:
#registers
#ex-commands
#command-line
#normal-mode
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 jump to the global definition of a variable or function in Vim?
How it works Vim provides two built-in commands for jumping to where an identifier is defined, without needing tags or an LSP: gd (lowercase) searches backward
category:
navigation
tags:
#navigation
#normal-mode
#motions
How do I search and replace only whole word matches, not partial matches?
Wrapping your search pattern in \ word boundary anchors ensures that Vim only matches the exact whole word, preventing accidental replacements inside longer wor
category:
search
tags:
#search
#substitution
#regex
#ex-commands
#editing
How do I quickly jump between method or function definitions in code?
The ]m and [m motions let you jump forward and backward between the start of method or function definitions.
category:
navigation
tags:
#navigation
#motions
#normal-mode
#editing
How do I see git diff changes in the Vim sign column with vim-gitgutter?
vim-gitgutter is a plugin that shows git diff markers in the sign column (the narrow column to the left of line numbers).
category:
plugins
tags:
#plugins
#editing
#navigation
How do I reduce the jarring jump when the cursor reaches the screen edge by making Vim scroll multiple lines at once?
When scrolloff is 0 and the cursor moves just past the screen boundary, Vim scrolls by exactly one line, which can feel abrupt during rapid navigation.
category:
config
tags:
#config
#navigation
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 keep my undo history after closing and reopening a file?
By default, Vim's undo history is lost when you close a file.
category:
config
tags:
#config
#undo-redo
#productivity
#vimrc
#advanced