How do I delete a word and its surrounding whitespace?
daw
The daw command deletes a word including one side of its surrounding whitespace.
953 results for ":normal"
daw
The daw command deletes a word including one side of its surrounding whitespace.
:let @q .= 'j.'
When a recorded macro is almost right but missing one repeated step, re-recording from scratch is usually slower and riskier than patching the register directly
g??
Vim has a built-in ROT13 operator g? that encodes text by rotating each letter 13 positions in the alphabet.
g8
Pressing g8 in normal mode displays the UTF-8 encoding of the character under the cursor as a sequence of hex bytes.
g?iw
g? is Vim’s built-in ROT13 operator.
*cgn
Global substitution is fast, but sometimes you need selective control over each occurrence.
:g/./t.\<CR>
The :global command can apply an Ex action to every line that matches a pattern.
cr
The vim-abolish plugin (by tpope) provides a cr (coerce) operator that converts the word under the cursor between naming conventions with a single keystroke pai
[* and ]*
The [ and ] motions (also written as [/ and ]/) let you jump directly to the opening / or closing / of a C-style block comment.
ci{
The ci{ command deletes everything inside the nearest pair of curly braces {} and places you in insert mode to type a replacement.
P
The P (uppercase) command pastes the contents of the default register before the cursor position.
gUU
The gUU command uppercases every character on the current line instantly — no visual selection or motion required.
getreginfo('a')
getreginfo('{reg}') (Vim 8.
dp
In Vim's diff mode, dp (diff put) and do (diff obtain) are single-keystroke shorthands for :diffput and :diffget.
buffers-windows #diff #buffers-windows #editing #normal-mode
qa Yp <C-a> q
By combining a macro with (increment number), you can quickly generate numbered sequences.
g~ap
g~ap is a fast way to invert letter case across a full paragraph without entering Visual mode.
editing #editing #operators #text-objects #case #normal-mode
g<C-a>
The g command increments numbers across a visual selection so that each subsequent line gets a progressively higher value.
"ayy ... "ap
Named registers let you store multiple pieces of text independently.
:call setreg('q', 'dd')
The setreg() VimScript function lets you populate any register with arbitrary content directly from the command line or a script — no recording required.
xp
The xp command swaps the character under the cursor with the character to its right.