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 copy or transfer text between Vim registers?
Vim's :let @{reg} syntax lets you read from one register and write to another.
category:
registers
tags:
#registers
#ex-commands
#editing
#command-line
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 run a command on lines between two search patterns?
Vim allows pattern-based ranges in Ex commands, letting you operate on lines between two search matches.
category:
command-line
tags:
#command-line
#ranges
#patterns
#ex-commands
How do I open the command-line window while typing a command on the : prompt?
<C-f> (from command-line mode)
When you are partway through typing a long or complex Ex command on the : prompt, you can press to open the command-line window.
category:
search
tags:
#command-line
#ex-commands
#editing
#normal-mode
How do I run a substitute command without overwriting my current search pattern?
:keeppattern %s/old/new/g
When you run a :s or :%s substitute command, Vim updates the search register (@/) with the substitution pattern.
category:
command-line
tags:
#ex-commands
#search
#editing
#registers
#substitute
How do I run normal mode commands on a range while ignoring custom mappings?
The :norm! (or :normal!) command executes normal mode keystrokes while ignoring all user-defined mappings.
category:
command-line
tags:
#ex-commands
#editing
#normal-mode
How do I force Vim to check if open files were changed externally and reload them?
The :checktime command tells Vim to check whether any open buffers have been modified outside of Vim and prompt you to reload them.
category:
buffers-windows
tags:
#buffers
#ex-commands
#editing
How do I run a command across all open buffers at once?
:bufdo %s/old/new/ge | update
The :bufdo command executes an Ex command in every loaded buffer.
category:
buffers-windows
tags:
#buffers
#ex-commands
#editing
#substitution
How do I evaluate expressions and insert results inline in Vim?
The expression register (=) is one of Vim's most powerful yet underused features.
category:
registers
tags:
#registers
#insert-mode
#ex-commands
#editing
How do I copy the current file's full path to the system clipboard?
Sometimes you need to share or use the full path of the file you're editing — for a terminal command, a config file, or a chat message.
category:
registers
tags:
#registers
#ex-commands
#editing
#clipboard
How do I run a substitution across all files in the argument list?
:argdo %s/old/new/g | update
The :argdo command runs an Ex command on every file in the argument list (the files you opened Vim with, or added via :argadd).
category:
command-line
tags:
#ex-commands
#editing
#command-line
How do I match only part of a search pattern for highlighting or substitution?
The \zs and \ze atoms let you define where the actual match starts and ends within a larger pattern.
category:
search
tags:
#search
#editing
#ex-commands
How do I run Normal mode commands in a script without triggering my custom mappings?
:normal {keys} executes keystrokes as if typed in Normal mode — but it respects your custom mappings and abbreviations.
category:
macros
tags:
#macros
#ex-commands
#normal-mode
How do I collapse multiple consecutive spaces into a single space throughout a file?
The pattern \s\+ matches one or more whitespace characters (spaces, tabs).
category:
editing
tags:
#editing
#search
#ex-commands
How do I incrementally grow or shrink a split window by a specific number of lines or columns?
:resize adjusts the height of the current window by a relative or absolute amount.
category:
buffers-windows
tags:
#buffers-windows
#ex-commands
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 I open an existing buffer in a new split window?
The :sb (short for :sbuffer) command opens a buffer that is already loaded in Vim in a new horizontal split window.
category:
buffers-windows
tags:
#buffers
#windows
#ex-commands
How do I run a macro or command on every entry in the location list?
:ldo runs an Ex command on each entry in the location list — the buffer-local cousin of the quickfix list.
category:
macros
tags:
#macros
#ex-commands
#editing
How do I list all buffers including unlisted ones like help pages and terminal buffers?
:ls (or :buffers) shows Vim's buffer list, but it hides unlisted buffers — help files, directory listings (netrw), terminal buffers, and scratch buffers marke
category:
buffers-windows
tags:
#buffers-windows
#ex-commands