How do I filter a range of text through an external shell command directly in normal mode?
The ! operator in normal mode lets you pipe any motion's text through a shell command and replace it with the output.
category:
editing
tags:
#editing
#shell
#external-command
#normal-mode
#filtering
How do I run normal mode commands in a script or macro without user mappings interfering?
The :normal! command (with !) executes normal mode keystrokes exactly as Vim defines them, ignoring any user-defined mappings.
category:
macros
tags:
#macros
#ex-commands
#normal-mode
#editing
How do I move to the diagonally opposite corner of a blockwise visual selection?
In Visual-Block mode (), pressing O moves the cursor to the diagonally opposite corner of the rectangular selection.
category:
visual-mode
tags:
#visual-mode
#editing
#normal-mode
How do I make the K key look up words in Vim's own help instead of the man page?
By default, pressing K in Normal mode runs the word under the cursor through an external program — usually man.
category:
config
tags:
#config
#ex-commands
#normal-mode
How do I jump to the start or end of a C-style comment block?
Vim provides two motions for navigating C-style block comments (/ .
category:
navigation
tags:
#navigation
#motions
#comments
#normal-mode
How do I move the current line up or down using an Ex command?
The :move (:m) command relocates a line to a new position without cutting and pasting.
category:
command-line
tags:
#editing
#ex-commands
#normal-mode
How do I navigate all undo states including branches that u and Ctrl+r can't reach?
Vim's undo history is a tree, not a linear stack.
category:
navigation
tags:
#undo-redo
#navigation
#normal-mode
How do I jump to the opening or closing brace of the block surrounding my cursor?
The [{ motion jumps to the previous unmatched { — the opening brace of the block enclosing your cursor.
category:
navigation
tags:
#navigation
#motions
#editing
#normal-mode
How do I toggle the case of a rectangular column region across multiple lines?
Visual block mode () selects a rectangular column region, and pressing ~ at the end toggles the case of every character in that exact column range across all se
category:
visual-mode
tags:
#visual-mode
#editing
#case
#normal-mode
How do I filter a range of text through an external shell command in Vim?
The ! operator passes text selected by a motion through an external shell command, replacing it with the command's output.
category:
editing
tags:
#editing
#normal-mode
#ex-commands
How do I convert text to title case (capitalize first letter, lowercase the rest of each word)?
Vim's substitute command supports case-conversion escape sequences in the replacement string.
category:
search
tags:
#search
#editing
#normal-mode
#ex-commands
How do I clear a macro register to start fresh without using Vimscript?
Pressing qqq in normal mode is the quickest way to empty a macro register.
category:
macros
tags:
#macros
#registers
#normal-mode
How do I add or remove words from Vim's spell check dictionary?
When Vim's spell checker marks a word as incorrect but it is intentionally spelled that way (a name, abbreviation, or domain-specific term), you can permanently
category:
config
tags:
#config
#spell-check
#editing
#normal-mode
How do I insert text at the very first column of a line, ignoring indentation?
Most Vim users know I to insert at the start of a line — but I actually jumps to the first non-blank character, skipping leading whitespace.
category:
editing
tags:
#editing
#insert-mode
#normal-mode
#indentation
How do I programmatically set a register's content in Vim without yanking?
Vim's :let command lets you assign a value directly to any named register without performing a yank or delete operation.
category:
registers
tags:
#registers
#macros
#vimscript
#ex-commands
#normal-mode
How do I run a recorded macro on every file in my argument list at once?
The :argdo command applies any Ex command to every file in the argument list.
category:
macros
tags:
#macros
#ex-commands
#argdo
#normal-mode
#editing
How do I search for and highlight text that exceeds a specific column width like 80 or 120?
The pattern /\%>80v.
category:
search
tags:
#search
#navigation
#normal-mode
How do I run a macro a dynamically computed number of times or interleave it with other commands?
:for i in range(1,10) | execute "normal @q" | endfor
Using a Vimscript :for loop with execute "normal @q" lets you run a macro with a dynamically computed iteration count and interleave other Ex commands between i
category:
macros
tags:
#macros
#ex-commands
#normal-mode
How do I insert the output of any Vim Ex command directly into the current buffer?
The :put =execute('{cmd}') idiom inserts the output of any Vim Ex command as text in your buffer.
category:
registers
tags:
#registers
#ex-commands
#command-line
#normal-mode
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