How do I paste a register's content in Insert mode without Vim adjusting the indentation?
The standard {reg} pastes register contents in Insert mode, but Vim may auto-indent multi-line text to match the current indentation level — sometimes manglin
category:
registers
tags:
#registers
#insert-mode
#editing
How do I jump forward through the jump list after going back with Ctrl-O?
Every time you make a "jump" — using G, /, %, :tag, , or similar commands — Vim records your position in the jump list.
category:
navigation
tags:
#navigation
#normal-mode
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 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 run a search and replace only within a visually selected region?
:'<,'>s/pattern/replacement/g
When you make a visual selection and then type :, Vim automatically inserts ' as the range — the marks for the start and end of the last visual selection.
category:
visual-mode
tags:
#visual-mode
#search
#editing
How do I quickly navigate quickfix entries, buffers, and toggle options with bracket keys?
The vim-unimpaired plugin by Tim Pope provides pairs of bracket mappings for common navigation and toggling tasks.
category:
plugins
tags:
#plugins
#navigation
#buffers
#quickfix
How do I make wrapped lines preserve their indentation level?
When wrap is enabled, long lines wrap to the next screen row starting at column 1 by default, which makes indented code look messy.
category:
config
tags:
#config
#formatting
#indentation
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 call one macro from inside another macro in Vim?
When recording a macro, you can execute another macro inside it by pressing @b (or any register) during the recording.
category:
macros
tags:
#macros
#registers
#normal-mode
#editing
How do I insert the filename under the cursor directly into the command line?
While typing a command, inserts the filename under the cursor in the buffer at the command-line prompt.
category:
command-line
tags:
#command-line
#navigation
#editing
How do I move the cursor to the last non-blank character on the current line?
g moves the cursor to the last non-blank character of the current line — skipping trailing spaces and tabs.
category:
navigation
tags:
#navigation
#motions
#normal-mode
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 convert the entire current line to lowercase or uppercase in one command?
Vim's case operators gu (lowercase) and gU (uppercase) follow the same doubling convention as dd and yy: repeating the operator letter applies it to the whole c
category:
editing
tags:
#editing
#normal-mode
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
How do I paste or reuse my last search pattern from the search register?
Vim stores the last search pattern in the search register "/.
category:
registers
tags:
#registers
#search
#editing
How do I limit the height of Vim's insert-mode completion popup menu?
By default, Vim's completion popup menu (the PUM — Pop-Up Menu) can expand to fill the entire screen if there are many candidates.
category:
config
tags:
#config
#completion
How do I increment and decrement dates, times, and other structured sequences in Vim?
<C-a> / <C-x> (vim-speeddating)
vim-speeddating (by Tim Pope) extends Vim's built-in and increment/decrement operators to understand dates, times, roman numerals, and other ordered sequences.
category:
plugins
tags:
#plugins
#editing
#normal-mode