How do I jump back in the jumplist and automatically reveal and center the destination?
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
category:
navigation
tags:
#navigation
#jumplist
#folding
#normal-mode
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 prepend text to every selected line even with uneven indentation?
Visual Block insert (I.
category:
visual-mode
tags:
#visual-mode
#ex-commands
#normal-mode
#editing
How do I search for the exact text I have selected?
By yanking a visual selection and pasting it into the search prompt with \V (very nomagic), you can search for exact text including special characters.
category:
visual-mode
tags:
#visual-mode
#search
How do I visually select an entire sentence in Vim?
The vas command visually selects the current sentence, including surrounding whitespace.
category:
visual-mode
tags:
#visual-mode
#text-objects
#motions
How do I enable an alternative digraph entry mode where I type two characters then backspace?
With :set digraph enabled, you can enter special characters in insert mode by typing the two-character digraph code followed by (backspace).
category:
config
tags:
#insert-mode
#digraphs
#unicode
#special-characters
#config
How do I search and replace only whole words and not partial matches in Vim?
:%s/\<word\>/replacement/g
How it works In Vim's regular expressions, \ are word boundary anchors: \ matches the end of a word.
category:
editing
tags:
#editing
#search
#ex-commands
How do I create custom folds to collapse specific sections of code?
Vim supports several fold methods, but manual folding with zf gives you precise control over exactly which lines to collapse.
category:
editing
tags:
#folding
#normal-mode
#visual-mode
#editing
How do I copy characters from the line above or below the cursor while staying in insert mode?
<C-y> (above) / <C-e> (below)
In insert mode, inserts the character from the same column one line above, and inserts the character from the same column one line below.
category:
editing
tags:
#editing
#insert-mode
#normal-mode
How do I clear search highlights without disabling hlsearch permanently?
After a search in Vim, matched text is highlighted as long as hlsearch is enabled.
category:
search
tags:
#search
#hlsearch
#highlight
#ex-commands
How do I paste register contents in insert mode without triggering auto-indentation?
When you paste a register in insert mode with {reg}, Vim inserts the text as if you had typed it — which means auto-indent, abbreviation expansion, and other
category:
registers
tags:
#registers
#insert-mode
#paste
#autoindent
#editing
How do I select an entire paragraph in Vim?
The vip command visually selects the inner paragraph — all contiguous non-blank lines surrounding the cursor.
category:
visual-mode
tags:
#visual-mode
#text-objects
#editing
#normal-mode
How do I navigate between diagnostics with filtering by severity in Neovim 0.10+?
Neovim 0.
category:
plugins
tags:
#navigation
#editing
How do I use Git from within Vim with vim-fugitive?
:Git command (e.g., :Git status)
vim-fugitive by Tim Pope is a comprehensive Git wrapper for Vim.
category:
plugins
tags:
#plugins
#ex-commands
How do I save multiple different views of the same file with independent fold and cursor states?
:mkview 2 and :loadview 2
Vim supports up to 9 numbered view slots per file.
category:
buffers-windows
tags:
#folding
#buffers-windows
#navigation
#config
How do you list all marks in Vim?
Use :marks to display all current marks with their line numbers, column positions, and file/text.
category:
command-line
tags:
#command-line
#marks
#list
How do I swap the first two whitespace-separated columns on every line?
:%s/\v(\S+)\s+(\S+)/\2 \1/<CR>
When you need to flip two fields across a whole file, a single substitution is faster and safer than recording a macro.
category:
editing
tags:
#editing
#substitution
#regex
#ex-commands
#formatting
How do I control how many columns Vim scrolls horizontally at once when the cursor reaches the screen edge?
When wrap is off and the cursor moves past the edge of the screen, Vim jumps the view horizontally by a number of columns determined by sidescroll.
category:
config
tags:
#config
#navigation
#editing
How do I populate the quickfix list from the output of an external shell command?
:cexpr system('grep -rn TODO .')
The :cexpr command evaluates an expression and parses the result as quickfix entries using the current errorformat.
category:
command-line
tags:
#ex-commands
#search
#editing
#buffers
How do I mark and delete multiple files at once from within Vim's built-in file explorer netrw?
Vim's built-in file browser netrw (opened with :Explore or :Ex) supports a full file management workflow beyond simple navigation.
category:
plugins
tags:
#navigation
#buffers
#ex-commands