How do I use POSIX character classes like [:alpha:] and [:digit:] in Vim search patterns?
Vim's regex engine supports POSIX character classes inside bracket expressions, giving you locale-aware, readable alternatives to manual character ranges like [
category:
search
tags:
#search
#regex
#patterns
#character-classes
How do I swap the position of two windows?
The r command rotates windows in the current row or column.
category:
buffers-windows
tags:
#windows
#normal-mode
How do I fuzzy find and open files instantly in Vim?
The fzf.
category:
plugins
tags:
#plugins
#fzf
#files
#navigation
#fuzzy-finder
How do I refresh the diff highlighting in Vim when it becomes stale after editing?
After making edits in a vimdiff session, the diff highlighting can become out of sync with the actual content — showing incorrect change markers or missing hu
category:
buffers-windows
tags:
#buffers-windows
#diff
#editing
How do I search and replace only whole words and not partial matches in Vim?
:%s/\<word\>/replacement/g
How it works In Vim's regular expressions, \ are word boundary anchors: \ matches the end of a word.
category:
editing
tags:
#editing
#search
#ex-commands
How do I create custom folds to collapse specific sections of code?
Vim supports several fold methods, but manual folding with zf gives you precise control over exactly which lines to collapse.
category:
editing
tags:
#folding
#normal-mode
#visual-mode
#editing
How do I copy characters from the line above or below the cursor while staying in insert mode?
<C-y> (above) / <C-e> (below)
In insert mode, inserts the character from the same column one line above, and inserts the character from the same column one line below.
category:
editing
tags:
#editing
#insert-mode
#normal-mode
How do I close all folds and then open just the one containing the cursor to focus on it?
The zMzv sequence collapses every fold in the file and then re-opens only the one containing your cursor.
category:
editing
tags:
#folding
#navigation
#normal-mode
How do I run an external shell command from Vim without the press-enter prompt afterward?
Running :!cmd in Vim shows the command's output and then pauses with a "Press ENTER or type command to continue" prompt.
category:
command-line
tags:
#command-line
#ex-commands
#shell
#editing
How do I quickly switch between the current file and the last edited file?
Pressing (Ctrl-6 on most keyboards) instantly toggles between the current buffer and the alternate file — the last file you were editing.
category:
buffers-windows
tags:
#navigation
#buffers
#normal-mode
#productivity
#windows
How do I paste register contents in insert mode without triggering auto-indentation?
When you paste a register in insert mode with {reg}, Vim inserts the text as if you had typed it — which means auto-indent, abbreviation expansion, and other
category:
registers
tags:
#registers
#insert-mode
#paste
#autoindent
#editing
How do I paste text and automatically adjust its indentation?
The ]p command pastes text and adjusts its indentation to match the current line.
category:
editing
tags:
#editing
#indentation
#normal-mode
How do I select an entire paragraph in Vim?
The vip command visually selects the inner paragraph — all contiguous non-blank lines surrounding the cursor.
category:
visual-mode
tags:
#visual-mode
#text-objects
#editing
#normal-mode
How do I rotate split windows forward without reopening any buffers?
When a split layout is correct but the window positions are awkward, you do not need to close and reopen anything.
category:
buffers-windows
tags:
#windows
#buffers
#command-line
#navigation
How do I delete or change text without overwriting my previously yanked text?
Vim's black hole register (") acts as a write-only sink: anything sent to it is discarded without affecting any other register, including the unnamed register (
category:
registers
tags:
#registers
#delete
#editing
#normal-mode
How do I prevent Vim from pausing at the --More-- prompt when displaying long command output?
When a Vim command produces output that exceeds the terminal height, Vim pauses and displays a -- More -- prompt, requiring you to press a key to continue.
category:
config
tags:
#config
#command-line
#ex-commands
How do I diff two files that are already open in Vim splits?
You often have two files open side by side and want to compare them without leaving Vim or launching vimdiff.
category:
navigation
tags:
#buffers
#windows
#editing
#navigation
How do I change the key that opens Vim's command-line window?
Vim's command-line window is invaluable for editing long : commands, search patterns, and complex substitutions with normal-mode tools.
category:
config
tags:
#config
#command-line
#options
#workflow
How do I navigate between diagnostics with filtering by severity in Neovim 0.10+?
Neovim 0.
category:
plugins
tags:
#navigation
#editing
How do I toggle, uppercase, or lowercase text using motion commands in Vim?
Vim has three case-change operators that work like any other operator — you can combine them with motions, text objects, or double them to act on the whole li
category:
visual-mode
tags:
#editing
#visual-mode
#normal-mode
#text-objects