How do I fold and unfold sections of code to hide details I'm not working on?
Vim's folding system lets you collapse blocks of code into a single line, hiding the details so you can focus on the structure.
category:
editing
tags:
#editing
#folding
#navigation
#normal-mode
#productivity
How do I navigate by sentences, paragraphs, and sections in Vim?
Vim provides structural navigation motions that move by sentences, paragraphs, and sections.
category:
navigation
tags:
#navigation
#motions
#sentence
#paragraph
How do I set up automatic typo correction in Vim using abbreviations?
Vim's abbreviation feature lets you define automatic text replacements that trigger as you type.
category:
command-line
tags:
#insert-mode
#editing
#ex-commands
How do I access text from small deletes like dw or x?
The small delete register ("-) captures text from delete operations that are less than one line — like dw, x, dt.
category:
registers
tags:
#registers
#delete
#paste
#normal-mode
How do I run a substitute command on every file in the quickfix list at once?
:cfdo %s/old/new/ge | update
When you grep across your project and want to perform a search-and-replace on every file that matched, :cfdo is the most efficient approach.
category:
command-line
tags:
#quickfix
#substitute
#search
#ex-commands
#editing
How do I get improved % matching for language keywords like if/else/endif in Vim?
The vim-matchup plugin by Andy Massimino is a drop-in replacement for Vim's built-in matchit plugin that supercharges the % key to work with language-specific k
category:
plugins
tags:
#plugins
#matchup
#navigation
#text-objects
#matching
How do I navigate through code using tags and the tag stack?
The command jumps to the definition of the keyword under the cursor using a tags file, and jumps back.
category:
navigation
tags:
#navigation
#tags
#code-navigation
#ctags
How do I jump to a specific column number on the current line?
The command (pipe character) moves the cursor to a specific column number on the current line.
category:
navigation
tags:
#navigation
#motions
#columns
#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 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 insert the current filename into the buffer or use it in commands?
Vim has several read-only registers that hold special values.
category:
registers
tags:
#registers
#insert-mode
#normal-mode
#editing
How do I configure Vim's built-in file explorer netrw to look like a sidebar?
let g:netrw_liststyle=3 and let g:netrw_banner=0
How it works Vim ships with a built-in file explorer called netrw that you can access with :Explore (or :Ex).
category:
config
tags:
#navigation
#buffers
#windows
How do I force a motion to act blockwise, linewise, or characterwise?
Vim lets you override the natural type of any motion by pressing v, V, or between the operator and the motion.
category:
editing
tags:
#editing
#motions
#visual-mode
#advanced
#normal-mode
How do I quickly convert between snake_case, camelCase, and other naming conventions in Vim?
Tim Pope's vim-abolish plugin provides cr (coerce) commands that instantly convert the word under the cursor between common naming conventions.
category:
plugins
tags:
#editing
#plugins
#formatting
#normal-mode
How do I perform a non-greedy (minimal) match in Vim search?
How it works In most regex engines, ? or +? make quantifiers non-greedy (matching as little as possible).
category:
search
tags:
#search
#normal-mode
#ex-commands
How do I search and filter through command-line history in Vim?
Vim's command-line history window (q: for Ex commands, q/ for search) opens a full editing buffer containing your history.
category:
command-line
tags:
#command-line
#history
#search
#recall
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 run a substitute command without overwriting my current search pattern?
Normally, any command that uses a pattern — including :substitute, :global, and :vimgrep — replaces the current search register @/ with the new pattern.
category:
command-line
tags:
#search
#ex-commands
#editing
#command-line
How do I cycle through all lowercase marks in the current file sequentially?
The ]' command jumps to the start of the line containing the next lowercase mark in the file, while [' jumps to the previous one.
category:
navigation
tags:
#navigation
#marks
#normal-mode
How do I change the cursor shape for different Vim modes in the terminal?
Modern terminals support cursor shape changes via escape sequences.
category:
config
tags:
#config
#cursor
#terminal
#visual-feedback