How do I create a self-repeating recursive macro that runs until it reaches the end of the file?
A recursive macro calls itself at the end of its recording, causing it to repeat automatically until an error — such as reaching the end of the file — stops
category:
macros
tags:
#macros
#registers
#editing
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 append text to the end of multiple lines that have different lengths?
Visual block mode normally selects a fixed-width column, which makes appending tricky when lines have different lengths.
category:
visual-mode
tags:
#visual-mode
#editing
#insert-mode
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 record and replay a macro in Vim?
Macros let you record a sequence of commands and replay them.
category:
macros
tags:
#macros
#automation
#registers
#normal-mode
How do I browse and reuse my previous search patterns in Vim?
How it works Vim keeps a history of all your search patterns.
category:
search
tags:
#search
#navigation
#normal-mode
How do I toggle line wrapping on or off in Vim?
:set wrap! or :set nowrap
How it works By default, Vim wraps long lines that extend past the window width, displaying them across multiple screen lines.
category:
config
tags:
#visual-mode
#formatting
#navigation
How do I add a per-window title bar showing the current file name in Neovim?
Neovim 0.
category:
config
tags:
#config
#buffers-windows
#statusline
#neovim
What is the difference between word and WORD motions in Vim?
Vim distinguishes between "words" (sequences of keyword characters) and "WORDS" (sequences of non-blank characters).
category:
navigation
tags:
#navigation
#motions
#word
#word-motion
How do I replace only part of a match in :substitute without capture groups?
When your match has a stable prefix but you only want to replace the trailing segment, \zs is often cleaner than introducing extra capture groups.
category:
search
tags:
#search
#ex-commands
#formatting
#editing
How do I perform arithmetic calculations and insert the result without leaving insert mode?
The expression register ("=) lets you evaluate any Vimscript expression and insert the result directly into the buffer — all without leaving insert mode.
category:
registers
tags:
#registers
#insert-mode
#editing
#ex-commands
How do I jump to the next misspelled word in my buffer using Vim's built-in spell check?
When spell checking is enabled with :set spell, Vim underlines misspelled words in the buffer.
category:
navigation
tags:
#navigation
#search
#spelling
How do I write a Vim macro that automatically repeats until it fails?
A recursive macro is one that calls itself as its final action, causing it to repeat indefinitely until any command in the body fails (e.
category:
macros
tags:
#macros
#registers
#normal-mode
#editing
How do I set the maximum line width for automatic text wrapping?
The textwidth option sets the maximum width for text.
category:
config
tags:
#config
#formatting
#ex-commands
How do I reuse the last search pattern without retyping it in Vim?
In Vim, pressing // (two forward slashes) in Normal mode repeats the last search pattern.
category:
search
tags:
#search
#normal-mode
#motions
How do I load a plugin on demand using Vim's native package system?
Vim 8+ and Neovim have a built-in package manager.
category:
plugins
tags:
#plugins
How do I sort only a visual selection using a fixed virtual column as the key?
When lines contain aligned columns, plain :sort often gives the wrong order because it compares from column 1.
category:
visual-mode
tags:
#visual-mode
#sorting
#text-processing
#command-line
How do I split a line by inserting a newline with the substitute command?
In Vim's substitute command, use \r (not \n) in the replacement to insert a real newline.
category:
editing
tags:
#editing
#search
#ex-commands
#substitution
How do I create shortcuts for long Ex commands I type frequently?
:cabbrev (command-line abbreviation) lets you define short aliases for longer Ex commands.
category:
command-line
tags:
#command-line
#ex-commands
#config
How do I define Vimscript functions that load automatically on demand without slowing down startup?
function! {name}#{funcname}() in autoload/{name}.vim
Vim's autoload mechanism lets you place functions in autoload/*.
category:
config
tags:
#config
#ex-commands
#normal-mode