How do I switch from typing a command to the full command-line window so I can edit it with all normal Vim keys?
<C-f> (from command-line)
When you are already in the middle of typing a command (after pressing :) and realize you need to compose something complex — a long substitution, a multi-pip
category:
command-line
tags:
#command-line
#editing
#normal-mode
How do I select a rectangular block of text in Vim?
The (Ctrl+v) command enters visual block mode, which lets you select a rectangular column of text across multiple lines.
category:
visual-mode
tags:
#visual-mode
#editing
#normal-mode
How do I delete or change an entire paragraph of text in one motion?
The dap and dip commands use Vim's paragraph text objects to delete an entire block of contiguous text in a single motion.
category:
editing
tags:
#editing
#text-objects
#normal-mode
#delete
#motions
How do I run a macro across all open buffers at once?
The :bufdo command executes an Ex command in every open buffer, and when combined with :normal @a, it replays macro a across all of them.
category:
macros
tags:
#macros
#buffers
#ex-commands
#automation
#productivity
How do I surround a visual selection with delimiters using vim-surround?
The vim-surround plugin provides the S command in visual mode to wrap any selection with a delimiter pair.
category:
plugins
tags:
#plugins
#surround
#visual-mode
#editing
#html
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 enable relative line numbers in Vim?
The :set relativenumber command displays line numbers relative to the cursor position instead of absolute line numbers.
category:
config
tags:
#config
#navigation
#normal-mode
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 select or operate on a block of code based on its indentation level in Vim?
The vim-indent-object plugin by Michael Smith adds text objects based on indentation level, giving you ii (inner indent) and ai (an indent) to select, delete, c
category:
plugins
tags:
#plugins
#indent
#text-objects
#editing
#python
How do I get more powerful text objects for quotes, brackets, and arguments in Vim?
The targets.
category:
plugins
tags:
#plugins
#targets
#text-objects
#editing
#motions