How do I temporarily highlight a custom text pattern in my buffer without changing the syntax file?
:match {group} /{pattern}/
:match lets you apply a highlight group to any pattern in the current window without touching the buffer or its syntax rules.
category:
config
tags:
#search
#config
#normal-mode
#ex-commands
How do I make Ctrl-A and Ctrl-X increment and decrement alphabetic characters?
By default, and only increment and decrement numbers (decimal, hex, and octal depending on format).
category:
config
tags:
#editing
#normal-mode
#config
#increment
How do I set a different working directory for each split window in Vim?
:lcd (local cd) sets the working directory for the current window only, leaving other windows at their previous directory.
category:
buffers-windows
tags:
#buffers-windows
#navigation
#ex-commands
#config
How do I create text shortcuts that auto-expand while typing in Vim?
:iabbrev defines insert-mode abbreviations that expand automatically when you type a non-keyword character (space, punctuation, ) after the abbreviation.
category:
config
tags:
#insert-mode
#config
#editing
How do I create a custom Vim operator that works with any motion or text object?
Vim's operatorfunc option lets you define your own operators — just like the built-in d, y, or c — that accept any motion or text object.
category:
config
tags:
#config
#macros
#vimscript
#normal-mode
How do I run a Vim command without triggering any autocommands?
The :noautocmd modifier (abbreviated :noa) runs any subsequent Ex command while temporarily disabling all autocommand events.
category:
command-line
tags:
#ex-commands
#editing
#config
How do I force Vim to recompute all folds in the current window?
The zx command resets and recomputes all folds in the current window based on the current foldmethod.
category:
config
tags:
#folding
#normal-mode
#config
How do I navigate between spelling errors and fix them in Vim?
Vim has a built-in spell checker that highlights misspelled words and provides correction suggestions — all without plugins.
category:
config
tags:
#config
#search
#navigation
How do I make word motions like w, b, and e treat hyphens or other characters as part of a word?
By default, Vim treats hyphens, dots, and many punctuation characters as word boundaries.
category:
config
tags:
#config
#navigation
#motions
#text-objects
How do I use % to jump between angle brackets in HTML or XML files?
By default, the % command jumps between (), {}, and [] pairs.
category:
config
tags:
#navigation
#config
#matchpairs
#editing
#normal-mode
How do I make gf find files when import paths omit the file extension?
:set suffixesadd+=.js,.ts,.jsx,.tsx
The gf (go to file) command opens the file under the cursor, but it fails when the path lacks an extension — common in JavaScript/TypeScript imports like impo
category:
navigation
tags:
#navigation
#config
#editing
#buffers
#file-management
How do I include dictionary and spelling words in Vim's insert-mode autocomplete?
Vim's built-in completion ( / ) sources matches from buffers, included files, and tags by default.
category:
editing
tags:
#completion
#insert-mode
#spell
#editing
#config
How do I keep the cursor line always centered on the screen while scrolling?
By default, Vim only scrolls the viewport when the cursor reaches the very top or bottom of the screen.
category:
navigation
tags:
#navigation
#scrolling
#config
#cursor
#scrolloff
How do I find out which scripts or plugins are slowing down my Vim startup?
When Vim feels sluggish to start, the built-in :profile command lets you measure exactly how much time each script, function, or plugin takes to load.
category:
config
tags:
#config
#performance
#debugging
#ex-commands
How do I set breakpoints and debug Vimscript functions interactively?
:breakadd func {funcname}
Vim has a built-in debugger for Vimscript that most users never discover.
category:
config
tags:
#ex-commands
#config
#debugging
#vimscript
How do I set a different statusline for a specific buffer or window?
:setlocal statusline=%f\ %m\ %y\ [%l/%L]
The :setlocal statusline command lets you override the global statusline for a specific window.
category:
config
tags:
#config
#statusline
#ex-commands
#buffers
How do I ignore whitespace changes when using Vim's diff mode?
When comparing files in Vim's diff mode, whitespace-only changes (extra spaces, changed indentation) can clutter the diff and hide meaningful edits.
category:
config
tags:
#config
#diff
#editing
#ex-commands
How do I set up Vim to parse errors from my compiler or linter into the quickfix list?
Vim ships with built-in compiler plugins that configure makeprg and errorformat for popular tools.
category:
command-line
tags:
#ex-commands
#config
#editing
How do I create a key mapping that behaves differently depending on context?
:nnoremap <expr> j (v:count == 0 ? 'gj' : 'j')
Expression mappings use the flag to evaluate a Vimscript expression at the time the key is pressed.
category:
config
tags:
#config
#normal-mode
#ex-commands
#navigation
How do I get enhanced tab completion with a visual menu for commands and file paths?
:set wildmenu wildmode=longest:full,full
By default, Vim's command-line tab completion just cycles through options.
category:
config
tags:
#config
#command-line
#completion