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
What is the difference between word and WORD motions in Vim?
Vim distinguishes between "words" (sequences of keyword characters) and "WORDS" (sequences of non-blank characters).
category:
navigation
tags:
#navigation
#motions
#word
#word-motion
How do I convert a visually selected block of text to uppercase or lowercase?
In visual mode, pressing U converts all selected characters to uppercase and u converts them to lowercase.
category:
visual-mode
tags:
#visual-mode
#editing
#normal-mode
How do I make the tilde key work as a case-toggle operator so I can use motions like ~w or ~ip?
By default, ~ toggles the case of a single character and advances the cursor.
category:
config
tags:
#editing
#config
#normal-mode
How do I uppercase or lowercase the entire current line in one keystroke?
The gUU command uppercases every character on the current line instantly — no visual selection or motion required.
category:
editing
tags:
#editing
#normal-mode
#formatting
How do I shift-indent all lines from the current cursor position to the end of the file?
The >G command applies a right-indent shift to every line from the cursor through the last line of the buffer.
category:
editing
tags:
#editing
#indentation
#motions
#normal-mode
How do I quickly jump to any location with two characters?
s{char}{char} (vim-sneak)
vim-sneak provides a motion that lets you jump to any location specified by two characters.
category:
plugins
tags:
#plugins
#navigation
#motions
How do I create a custom operator that works with motions and text objects?
:set operatorfunc=MyFunc<CR>g@
Vim lets you define custom operators that behave like built-in ones (d, c, y) — they wait for a motion or text object, then act on the selected region.
category:
config
tags:
#config
#normal-mode
#motions
#text-objects
#mapping
How do I use an external formatter with the gq operator in Vim?
Vim's gq operator normally reflows text to fit textwidth, but by setting formatprg you can delegate formatting to any external tool — a language formatter, a
category:
config
tags:
#formatting
#config
#editing
#ex-commands
How do I yank text from the cursor to the next occurrence of a pattern without entering visual mode?
Any operator in Vim can take a search motion as its argument.
category:
editing
tags:
#editing
#search
#motions
#normal-mode
How do I jump to just before a specific character on the current line?
The t{char} command moves the cursor forward to the character just before the next occurrence of {char} on the current line.
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I prevent cursor movement in insert mode from splitting the undo block?
inoremap <Left> <C-g>U<Left>
In insert mode, any cursor movement — including arrow keys, Home, and End — causes Vim to split the undo block at that point.
category:
editing
tags:
#insert-mode
#undo-redo
#editing
How do I convert selected text to uppercase?
In visual mode, pressing U converts all selected text to uppercase.
category:
visual-mode
tags:
#visual-mode
#editing
How do I make Vim display partial key sequences and selected character counts in real time?
The showcmd option makes Vim display the currently-typed command in the bottom-right corner of the screen, giving you live feedback as you build up key sequence
category:
config
tags:
#config
#normal-mode
#visual-mode
How do I delete through the end of the next search match from the cursor?
When you need to remove text up to a known marker, a plain search motion is often almost right but stops at the start of the match.
category:
navigation
tags:
#navigation
#search
#motions
#editing
How do I jump backward by paragraph in Vim?
The { motion moves the cursor backward to the previous blank line, jumping to the beginning of the current or previous paragraph.
category:
navigation
tags:
#navigation
#motions
#normal-mode
How do I use bracket mappings for paired operations?
[q, ]q, [b, ]b (vim-unimpaired)
vim-unimpaired by Tim Pope provides consistent bracket mappings for navigating paired items like quickfix entries, buffers, and more.
category:
plugins
tags:
#plugins
#navigation
How do I indent all lines from the cursor to the matching closing bracket in Vim?
Vim's > operator (indent) works with any motion or text object — including %, which jumps to the bracket, parenthesis, or brace matching the one under the cur
category:
editing
tags:
#editing
#indentation
#text-objects
#normal-mode
#motions
How do I restrict a search to the current function body?
By using the range [{,]}, you can limit a substitute command to the lines between the enclosing braces — effectively the current function or block.
category:
search
tags:
#search
#editing
#ex-commands
How do I make the gq operator format code with an external tool like prettier or black?
When formatprg is set, the gq operator pipes the selected text through that external program and replaces it with the program's output.
category:
editing
tags:
#editing
#formatting
#ex-commands
#config