How do I continuously record and restore sessions with vim-obsession?
If you routinely work across many files, tabs, and split layouts, rebuilding your workspace after a restart is costly.
category:
plugins
tags:
#plugins
#sessions
#workflow
#buffers-windows
#productivity
How do I rerun a previous search pattern from history directly on the / prompt?
/\V<C-r>=histget('/', -2)<CR>
If you often alternate between two complex search patterns, opening q/ each time is slow.
category:
search
tags:
#search
#command-line
#history
#regex
#productivity
How do I tune diffopt so diffs align moved code and produce cleaner hunks?
:set diffopt+=algorithm:patience,indent-heuristic,linematch:60
Default diff settings can produce noisy hunks when code is moved, re-indented, or lightly refactored.
category:
config
tags:
#config
#diff
#review
#productivity
How do I display available keybindings in a popup when pressing leader?
which-key.
category:
plugins
tags:
#plugins
#which-key
#keybindings
#productivity
How do I create abbreviations for common Ex commands?
Command-line abbreviations with cabbrev let you create short aliases for frequently used Ex commands.
category:
command-line
tags:
#command-line
#abbreviation
#shortcuts
#productivity
What are Vim's read-only special registers and how do I use them?
". / "% / ": / "# registers
Vim has four read-only special registers that automatically contain useful contextual information.
category:
registers
tags:
#registers
#special-registers
#workflow
#productivity
How do I delete characters, words, and lines without leaving insert mode?
Vim provides three levels of deletion directly in insert mode, so you don't need to switch to normal mode for small corrections.
category:
editing
tags:
#editing
#insert-mode
#delete
#productivity
How do I send commands from a Vim buffer to an embedded terminal?
:term then <C-w>N for normal mode
Vim 8+ and Neovim have a built-in terminal emulator that runs inside a buffer.
category:
command-line
tags:
#command-line
#terminal
#workflow
#productivity
How do I get a visual tab-completion menu for Vim commands and filenames?
The wildmenu option enhances Vim's command-line completion by showing a horizontal menu of matches above the command line when you press .
category:
config
tags:
#config
#command-line
#completion
#productivity
#vimrc
How do I yank text into a specific named register for later use?
Vim has 26 named registers (a-z) that act as independent clipboards.
category:
registers
tags:
#registers
#editing
#normal-mode
#yank
#productivity
How do I temporarily zoom a split window to full screen and then restore the layout?
<C-w>| and <C-w>_ / <C-w>=
Vim lets you temporarily maximize a split window to full width or full height, and then restore all windows to equal sizes with =.
category:
buffers-windows
tags:
#windows
#splits
#navigation
#productivity
#layout
How do I quickly surround a word with quotes, brackets, or parentheses?
Vim doesn't have a built-in "surround" operator, but you can wrap any word in quotes or brackets with a short sequence: ciw""P.
category:
editing
tags:
#editing
#text-objects
#normal-mode
#productivity
#surround
How do I swap a word with the contents of a register using visual mode?
The viwp command visually selects the word under the cursor and replaces it with the contents of the unnamed register (your last yank or delete).
category:
visual-mode
tags:
#editing
#visual-mode
#registers
#paste
#productivity
How do I use tab pages in Vim to organize multiple files?
Vim's tab pages let you organize your workspace into separate views, each containing its own window layout.
category:
buffers-windows
tags:
#buffers
#windows
#tabs
#navigation
#productivity
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 revert a file to its state from a specific time ago?
:earlier {time} / :later {time}
Vim's :earlier and :later commands let you navigate the undo history by wall-clock time rather than by individual undo steps.
category:
editing
tags:
#editing
#undo-redo
#ex-commands
#advanced
#productivity
How do I navigate undo branches to recover changes that were overwritten by a new edit?
Vim doesn't have a simple linear undo stack — it maintains a full undo tree with branches.
category:
editing
tags:
#editing
#undo-redo
#normal-mode
#advanced
#productivity
How do I use normal regex syntax in Vim search without escaping everything?
Vim's default regex syntax requires backslashes before most special characters like +, (, ), {, and , which is the opposite of what most developers expect from
category:
search
tags:
#search
#regex
#ex-commands
#productivity
#patterns
How do I search for a pattern across multiple files and navigate the results?
:vimgrep /pattern/ **/*.ext | copen
The :vimgrep command searches for a regex pattern across multiple files and populates the quickfix list with every match.
category:
search
tags:
#search
#quickfix
#ex-commands
#navigation
#productivity
#grep
How do I change the same column of text across multiple lines at once?
<C-v>jjc replacement<Esc>
Visual block mode's change command lets you replace a rectangular column of text across multiple lines in a single operation.
category:
visual-mode
tags:
#editing
#visual-mode
#block-mode
#normal-mode
#productivity