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 temporarily maximize a split window to full height or width?
When working with multiple splits, you sometimes need to focus on one window temporarily without closing the others.
category:
buffers-windows
tags:
#windows
#buffers
#navigation
#editing
How do I configure Tab and Backspace to always move by a fixed number of spaces when using expandtab?
When expandtab is enabled, Vim inserts spaces instead of a real tab character, but without softtabstop, Backspace only deletes one space at a time — not a ful
category:
config
tags:
#indentation
#config
#insert-mode
#editing
How do I jump to the first non-blank character of the next or previous line in a single motion?
The + and - motions jump to the first non-blank character of the next or previous line respectively — combining vertical movement and ^ into a single, count-a
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I convert text to title case in Vim using a substitution command?
Vim's substitution engine supports case-modifier sequences in the replacement string, making it possible to convert text to title case in a single command.
category:
search
tags:
#search
#substitution
#regex
#editing
#case
#formatting
How do I enable :Cfilter and :Lfilter commands without a plugin manager?
Vim ships with useful optional runtime plugins that many users never load.
category:
plugins
tags:
#plugins
#quickfix
#location-list
#search
#command-line
How do I run a substitute command without changing my current search pattern?
When you run a :s or :g command, Vim updates the search register (@/) with the pattern you used.
category:
command-line
tags:
#ex-commands
#search
#editing
#command-line
How do I add a per-window title bar in Neovim that shows context like the current filename?
Neovim 0.
category:
config
tags:
#config
#windows
#buffers-windows
How do I align text around a delimiter character using vim-lion?
vim-lion (by Tom McDonald) adds gl and gL as alignment operators.
category:
plugins
tags:
#plugins
#editing
#formatting
How do I uppercase or lowercase matched text directly in a substitute command?
Vim's substitute replacement string supports special case-transform atoms that change the case of matched text without requiring a second pass or an external to
category:
editing
tags:
#editing
#search
#ex-commands
#formatting
How do I filter a range of text through an external shell command directly in normal mode?
The ! operator in normal mode lets you pipe any motion's text through a shell command and replace it with the output.
category:
editing
tags:
#editing
#shell
#external-command
#normal-mode
#filtering
How do I do a case-preserving search and replace across different naming conventions?
:%Subvert/old{,s}/new{,s}/g
Tim Pope's vim-abolish plugin provides the :Subvert command (aliased as :S), which performs substitutions that automatically preserve case variants and handle p
category:
plugins
tags:
#plugins
#substitution
#editing
#ex-commands
#search
How do I write a Vim plugin using the autoload directory structure?
The autoload mechanism in Vim lets you write plugins whose functions are only loaded into memory when they are first called.
category:
plugins
tags:
#plugins
#ex-commands
#editing
How do I jump to a specific line number in Vim?
The 42G command jumps the cursor directly to line 42 in the current file.
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I view a file as it existed at a previous Git commit in Vim?
The vim-fugitive plugin lets you open any version of any file from your Git history directly in a Vim buffer using the :Gedit command.
category:
plugins
tags:
#plugins
#fugitive
#git
#history
#diff
How do I toggle a fold and all its nested folds open or closed at once?
The zA command toggles the fold under the cursor together with all nested sub-folds in one keystroke.
category:
editing
tags:
#folding
#editing
#normal-mode
How do I embed per-file Vim settings directly in a source file using modelines?
Vim's modeline feature lets you embed editor settings directly into a file.
category:
config
tags:
#config
#formatting
#indentation
How do I move lines to a different position without using yank and paste?
The :move command (abbreviated :m) relocates lines to a new position in the buffer without touching any registers.
category:
editing
tags:
#ex-commands
#editing
How do I populate a window-local location list for only the current file using ripgrep output?
:call setloclist(0, [], 'r', {'title': 'TODO current file', 'lines': systemlist('rg --vimgrep TODO ' . shellescape(expand('%:p'))), 'efm': '%f:%l:%c:%m'})
For focused review work, a window-local location list is often better than global quickfix.
category:
buffers-windows
tags:
#buffers
#windows
#location-list
#search
#quickfix
How do I programmatically read and write Vim register contents including their type from Vimscript?
The setreg(reg, value, type) and getreg(reg, 1, 1) functions give you full programmatic control over registers, including their type (characterwise, linewise, o
category:
registers
tags:
#registers
#vimscript
#macros
#ex-commands