How do I force a normally linewise motion to operate characterwise when combined with an operator?
In operator-pending mode — after typing an operator like d, y, or c but before the motion — you can press v, V, or to override the motion type to characterw
category:
editing
tags:
#editing
#motions
#normal-mode
#operators
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 switch between visual mode and select mode in Vim?
Vim has a lesser-known select mode that behaves like selection in typical GUI editors: any typed character replaces the selection.
category:
visual-mode
tags:
#visual-mode
#select-mode
#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 move the cursor in insert mode without creating an undo break point?
By default, moving the cursor with arrow keys while in insert mode creates an undo break — meaning a subsequent u will undo only back to when you last moved,
category:
editing
tags:
#insert-mode
#undo-redo
#editing
#advanced
How do I append text to the end of multiple lines with different lengths in visual block mode?
In visual block mode, pressing $ makes the right edge of the selection "ragged" — it extends to the real end of each line regardless of length.
category:
visual-mode
tags:
#visual-mode
#editing
#normal-mode
How do I insert the same text at the start (or end) of multiple lines simultaneously?
<C-v>{motion}I{text}<Esc>
Visual block mode () lets you select a rectangular region across multiple lines.
category:
visual-mode
tags:
#visual-mode
#editing
#normal-mode
How do I create a custom operator that works with any motion in Vim?
:set operatorfunc=MyFunc<CR>g@{motion}
Vim's operatorfunc and g@ let you define custom operators that accept any motion or text object, just like built-in operators d, c, and y.
category:
config
tags:
#config
#mapping
#normal-mode
#editing
How do I force a Vim operator to act linewise even when the motion is normally characterwise?
In operator-pending mode — the brief state after typing an operator like d, c, or y but before entering the motion — you can prefix the motion with v, V, or
category:
editing
tags:
#editing
#motions
#normal-mode
#operators
How do I change the case of text using operators and motions?
gU{motion} / gu{motion} / g~{motion}
Vim has three case operators that work with any motion or text object: gU for uppercase, gu for lowercase, and g~ for toggle case.
category:
editing
tags:
#editing
#case
#operators
#text-objects
#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
How do I execute a motion or command without adding an entry to the jump list?
The :keepjumps modifier lets you run any movement or command without recording a new entry in the jump list.
category:
navigation
tags:
#navigation
#ex-commands
#jump-list
#normal-mode
#vimscript
How do I filter text through an external program using a motion in normal mode?
The ! operator in normal mode lets you pipe a range of text through any external program and replace it with the output.
category:
editing
tags:
#editing
#normal-mode
#ex-commands
#formatting
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 use count prefixes to amplify motions and operators in Vim?
Almost every Vim motion and operator accepts a numeric count prefix that repeats or amplifies the action.
category:
navigation
tags:
#navigation
#motions
#count
#operators
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 create a custom Vim operator that works with any motion or text object?
Vim's operatorfunc option lets you define your own operators — just like the built-in d, y, or c — that accept any motion or text object.
category:
config
tags:
#config
#macros
#vimscript
#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 pipe selected text through an external command and replace it?
The ! operator in normal mode pipes text through an external shell command and replaces it with the output.
category:
command-line
tags:
#command-line
#shell
#editing
#filtering
#unix
How do I use a named mark as a motion target for operators like delete, yank, or indent in Vim?
Named marks are not just jump destinations — they serve as motion targets for any operator.
category:
navigation
tags:
#navigation
#marks
#editing
#motions
#normal-mode