How do I highlight a custom pattern in the current window without affecting the search register?
:call matchadd('ErrorMsg', 'TODO')
matchadd() lets you highlight arbitrary patterns using any highlight group — without touching the search register or search highlighting.
category:
config
tags:
#search
#config
#normal-mode
How do I diagnose plugin and system issues from within Neovim using the built-in health checker?
Neovim ships with a built-in health framework that runs diagnostic checks for core components and installed plugins.
category:
plugins
tags:
#config
#editing
#ex-commands
How do I make Vim spell check CamelCase and mixedCase identifiers as individual words?
By default, Vim treats camelCase as a single word and flags it as a spelling error even when both camel and case are correctly spelled.
category:
config
tags:
#config
#spell
#editing
How do I prevent autocommands from being registered multiple times when re-sourcing my vimrc?
augroup MyGroup | autocmd! | augroup END
Every time you run :source $MYVIMRC or :source % to reload your config, any bare autocmd calls are appended to Vim's autocommand table — no checking for dupli
category:
config
tags:
#config
#ex-commands
#autocmd
How do I make Vim's command-line tab completion case-insensitive for file and buffer names?
:set wildignorecase makes Vim's command-line tab completion treat uppercase and lowercase letters as equivalent when completing file names, buffer names, and ot
category:
command-line
tags:
#command-line
#completion
#config
#ex-commands
How do I make Vim remove the comment leader from the second line when joining two comment lines?
Adding the j flag to formatoptions causes Vim to strip the comment leader from the second line when two comment lines are joined with J.
category:
config
tags:
#editing
#formatting
#config
#ex-commands
How do I toggle all folding on and off globally with a single keystroke?
Pressing zi in normal mode toggles the foldenable option, which controls whether folds are active in the current window.
category:
config
tags:
#folding
#normal-mode
#config
How do I configure Vim's completion menu to show a popup without auto-selecting the first candidate?
:set completeopt=menuone,noselect
By default, Vim's and completion can auto-insert the first match, or only show a menu when there are multiple matches.
category:
config
tags:
#config
#completion
#insert-mode
How do I make Ctrl-A and Ctrl-X increment and decrement hexadecimal numbers?
By adding hex to the nrformats option, you tell Vim to recognise hexadecimal literals such as 0xFF or 0xDEAD when or is pressed.
category:
config
tags:
#config
#numbers
#increment
#normal-mode
#editing
How do I get a more accurate diff that avoids matching unrelated lines?
:set diffopt+=algorithm:histogram
Switches Vim's diff algorithm from the default Myers algorithm to histogram, which produces more semantically meaningful diffs by avoiding false matches between
category:
config
tags:
#diff
#config
#buffers
#editing
How do I prevent the cursor from jumping when opening a split in Neovim?
Controls how Neovim preserves the visual position of content when creating, closing, or resizing horizontal splits.
category:
buffers-windows
tags:
#windows
#splits
#neovim
#config
#buffers
How do I enable fuzzy matching for command-line tab completion in Neovim?
Enables fuzzy matching for Neovim's command-line tab completion (wildmenu), so you can match any part of a filename, command, or option — not just from the be
category:
command-line
tags:
#completion
#command-line
#neovim
#config
#wildmenu
How do I stop Vim from automatically continuing comment markers when I press Enter or open a new line?
By default, Vim continues the current comment leader when you press in insert mode or open a new line with o/O.
category:
config
tags:
#config
#editing
#formatting
#ex-commands
How do I control when Vim automatically wraps text or continues comment markers with formatoptions?
The formatoptions setting is a string of single-character flags that governs Vim's automatic text formatting: when lines wrap, whether comment syntax continues
category:
config
tags:
#config
#formatting
#ex-commands
#indentation
How do I create a mapping that does different things based on context?
nnoremap <expr> j (v:count == 0 ? 'gj' : 'j')
The map modifier turns a mapping's right-hand side into a Vimscript expression that is evaluated at the time the key is pressed, with its return value used as t
category:
config
tags:
#config
#normal-mode
#ex-commands
How do I exclude compiled files and dependency folders from Vim's file name completion?
:set wildignore+=*.pyc,*.o,node_modules/**,.git/**
wildignore is a comma-separated list of glob patterns that Vim skips when expanding file names.
category:
config
tags:
#config
#ex-commands
#completion
How do I make the = operator format code with an external tool like gofmt or black?
By default, Vim's = operator re-indents text using its internal rules.
category:
config
tags:
#config
#editing
#ex-commands
#formatting
#indentation
How do I make Vim always open new splits below and to the right instead of above and to the left?
:set splitright splitbelow
By default, :split opens a new window above the current one and :vsplit opens to the left — the opposite of most modern IDEs and editors.
category:
config
tags:
#config
#windows
#splits
#buffers-windows
How do I keep a horizontal margin between the cursor and the edge of the screen when scrolling sideways?
set sidescrolloff={n} keeps at least n columns of context to the left and right of the cursor when long lines cause the view to scroll horizontally.
category:
config
tags:
#config
#navigation
#normal-mode
How do I save and restore my entire Vim session including open buffers, windows, and layout?
:mksession saves a snapshot of the current Vim session — all open buffers, window splits, tab pages, cursor positions, and folds — to a file called Session.
category:
buffers-windows
tags:
#buffers-windows
#tabs
#config
#ex-commands