How do I find out which script or plugin defined a specific mapping or setting?
:verbose map <key> or :verbose set option?
The :verbose prefix shows where a mapping, setting, command, or function was defined — which file and line number.
category:
command-line
tags:
#command-line
#debugging
#config
#mappings
#workflow
How do I find where a Vim option or mapping was last set?
The :verbose prefix shows where an option was last set (which file, which line).
category:
command-line
tags:
#command-line
#config
#ex-commands
How do I log all Vim verbose output to a file to diagnose slow startup or plugin issues?
:set verbosefile=/tmp/vim.log verbose=9
Vim's verbosefile option redirects all verbose tracing output to a file on disk instead of printing it to the screen.
category:
config
tags:
#config
#debugging
#startup
#verbose
#ex-commands
How do I find which plugin or script defined a specific mapping?
The :verbose prefix on mapping commands shows not just the mapping definition but also the file and line number where it was defined.
category:
command-line
tags:
#command-line
#verbose
#debug
#mapping
How do I find out which file or plugin last set a particular Vim option?
:verbose set {option}? shows the current value of an option and reports exactly which file set it last — the full path and line number.
category:
command-line
tags:
#command-line
#config
#ex-commands
How do you find where a key mapping was defined?
Use :verbose map to see the mapping definition and the file/line where it was set.
category:
command-line
tags:
#command-line
#verbose
#mapping
How do I see where a normal-mode mapping was last defined in Vim?
When key behavior is inconsistent, the root cause is usually mapping precedence.
category:
command-line
tags:
#command-line
#mappings
#debugging
#config
#normal-mode
How do I find which script defined my BufWritePre autocommands?
:verbose autocmd BufWritePre
When a save hook starts behaving unexpectedly, the hard part is usually finding who defined it.
category:
command-line
tags:
#command-line
#autocmd
#debugging
#config
How do I filter the output of an Ex command to show only matching lines?
:filter /pattern/ command
The :filter command restricts the output of another Ex command to only lines matching a given pattern.
category:
command-line
tags:
#ex-commands
#command-line
#search
#buffers
How do I replace only part of a matched pattern using \zs and \ze in a substitution?
:%s/\zsparseData\ze(/processData/g
Vim's \zs and \ze atoms let you include context in your search pattern without including that context in the replacement.
category:
search
tags:
#search
#substitution
#regex
#editing
How do I suppress Vim's startup splash screen and reduce noisy status messages?
The shortmess option is a string of single-character flags that tell Vim which messages to suppress or abbreviate.
category:
config
tags:
#config
#messages
#startup
#options
How do I make Vim show error messages that are silently swallowed inside :silent! or :try blocks?
When troubleshooting mappings or scripts that use :silent!, errors disappear without a trace.
category:
config
tags:
#config
#macros
#ex-commands
How do I change an option's global default without affecting the current buffer's local value?
Vim maintains two values for most options: a global default that applies to new windows and buffers, and a local copy that can be overridden per-buffer or per-w
category:
config
tags:
#config
#ex-commands
#options
How do I see all recent Vim messages, errors, and echo output I may have missed?
:messages displays the full log of recent Vim messages — errors, warnings, echo output, and status notifications.
category:
command-line
tags:
#ex-commands
#command-line
How do I make the K key look up documentation in a language-specific tool instead of man pages?
The K key in normal mode looks up the word under the cursor using the program defined by keywordprg.
category:
config
tags:
#config
#navigation
#ex-commands
#command-line
How do I automatically detect and match a file's indentation settings in Vim?
The vim-sleuth plugin by Tim Pope automatically detects the indentation style (tabs vs spaces) and width used in a file and sets shiftwidth, expandtab, tabstop,
category:
plugins
tags:
#plugins
#sleuth
#indentation
#config
#workflow
How do I keep concealed text hidden while navigating but automatically reveal it when my cursor enters insert mode?
The 'concealcursor' option controls in which modes concealed text is revealed on the cursor line.
category:
config
tags:
#config
#display
#editing
#concealment
How do I convert a recorded macro into a permanent key mapping?
:let @q then use in nnoremap
Macros are stored in registers as plain keystroke strings.
category:
macros
tags:
#macros
#config
#vimrc
#mappings
#workflow
How do I remove the most recent Ex command from command history in Vim?
When you run sensitive or noisy Ex commands, they stay in command history and can be recalled accidentally.
category:
command-line
tags:
#command-line
#history
#ex-commands
#privacy
How do I use the leader key to create my own keyboard shortcuts?
let mapleader = ' ' then nnoremap <leader>key command
The leader key is a configurable prefix for your custom key mappings.
category:
config
tags:
#config
#mappings
#vimrc
#leader
#workflow