How do I capture the output of a Vim command into a register or buffer?
:redir @a | {cmd} | redir END
The :redir command redirects the output of Ex commands to a register, file, or variable instead of displaying it on the screen.
category:
command-line
tags:
#command-line
#ex-commands
#registers
#productivity
#advanced
How do I search for a pattern that spans multiple lines?
Vim's default .
category:
search
tags:
#search
#regex
#patterns
#advanced
#multiline
How do I open the current file on GitHub directly from Vim?
The vim-fugitive plugin combined with vim-rhubarb (for GitHub support) provides the :GBrowse command, which opens the current file on your repository's web host
category:
plugins
tags:
#plugins
#fugitive
#git
#github
#workflow
What is the location list and how does it differ from the quickfix list?
The location list is a per-window variant of the quickfix list.
category:
buffers-windows
tags:
#navigation
#quickfix
#ex-commands
#windows
#productivity
How do I scroll two split windows in sync so they move together?
The scrollbind option locks two or more windows together so that scrolling in one window automatically scrolls the others by the same amount.
category:
buffers-windows
tags:
#windows
#navigation
#splits
#diff
#productivity
How do I edit and reuse previous Ex commands in a full editing buffer?
The command-line window is a special buffer that shows your entire Ex command history and lets you edit entries using the full power of Vim's normal mode before
category:
command-line
tags:
#command-line
#ex-commands
#history
#editing
#productivity
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 keep my undo history after closing and reopening a file?
By default, Vim's undo history is lost when you close a file.
category:
config
tags:
#config
#undo-redo
#productivity
#vimrc
#advanced
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 save a recorded macro permanently so it persists across Vim sessions?
let @a = 'macro_contents'
Recorded macros are stored in registers, which are lost when you quit Vim (unless viminfo saves them).
category:
macros
tags:
#macros
#config
#registers
#vimrc
#productivity
How do I fuzzy search inside file contents across a project in Vim?
The fzf.
category:
plugins
tags:
#plugins
#fzf
#ripgrep
#search
#workflow
#quickfix
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 jump between changed lines in a Git-tracked file in Vim?
The vim-gitgutter plugin shows Git diff markers in the sign column and provides ]c and [c mappings to jump between changed hunks — groups of added, modified,
category:
plugins
tags:
#plugins
#gitgutter
#git
#navigation
#diff
How do I auto-complete words in insert mode without any plugins?
Vim has a powerful built-in completion system that requires zero plugins.
category:
editing
tags:
#editing
#insert-mode
#completion
#productivity
How do I stage or undo individual Git hunks without leaving Vim?
The vim-gitgutter plugin shows Git diff markers in the sign column and provides powerful commands to stage, undo, and preview individual hunks directly from Vim
category:
plugins
tags:
#plugins
#gitgutter
#git
#staging
#diff
#workflow