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 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 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 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 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
How do I find which Vim scripts or functions are slow and causing performance issues?
:profile start profile.log
When Vim feels sluggish, the built-in :profile command lets you measure exactly how much time each script and function consumes.
category:
config
tags:
#config
#ex-commands
#performance
How do I set different Vim options for specific programming languages?
autocmd FileType python setlocal ts=4 sw=4 et
Using autocmd FileType, you can configure Vim to automatically apply buffer-local settings whenever a file of a particular type is opened.
category:
config
tags:
#config
#ex-commands
#editing
#formatting
How do I fix broken or incorrect syntax highlighting in Vim?
Vim's syntax highlighting engine does not always parse the entire file from the beginning — it uses sync points to determine where to start parsing for the vi
category:
config
tags:
#config
#ex-commands
#editing
How do I create a custom operator that works with motions and text objects?
:set operatorfunc=MyFunc<CR>g@
Vim lets you define custom operators that behave like built-in ones (d, c, y) — they wait for a motion or text object, then act on the selected region.
category:
config
tags:
#config
#normal-mode
#motions
#text-objects
#mapping
How do I profile Vimscript functions to find what is slowing down Vim at runtime?
:profile start profile.log | profile func *
When Vim feels sluggish during editing—not just at startup—you need runtime profiling to pinpoint which functions are consuming the most time.
category:
config
tags:
#profiling
#debugging
#config
#ex-commands
#performance
How do I profile Vim functions at runtime to find what's making it slow?
:profile start /tmp/profile.log | profile func *
When Vim feels sluggish during editing (not just at startup), the :profile command lets you measure the execution time of every function call.
category:
config
tags:
#ex-commands
#config
#debugging