How do I delete a word and its surrounding whitespace?
daw
The daw command deletes a word including one side of its surrounding whitespace.
870 results for "it at"
daw
The daw command deletes a word including one side of its surrounding whitespace.
:call setreg('a', "foo\nbar", 'b')
Most register examples focus on interactive yanks, but setreg() lets you construct registers programmatically, including their type.
f{char} ; ,
The f, F, t, and T motions search for a character on the current line.
:g/^/normal I// <CR>
When you need to comment a whole block quickly, :global combined with :normal is faster than recording a macro or entering Visual Block mode.
:g/./t.\<CR>
The :global command can apply an Ex action to every line that matches a pattern.
:%s/\d\+/\=printf('%03d', submatch(0))/g
Combining Vim's \= expression substitution with the printf() function lets you apply arbitrary formatting to matched text.
:set shiftround
shiftround causes indent commands (>, always adds exactly shiftwidth spaces to whatever indentation the line already has With shiftround: > rounds up to the nex
:Lazy
lazy.
:Trouble diagnostics
trouble.
<C-r>=substitute(getreg('+'), '\n\+', ', ', 'g')<CR>
When you paste from the system clipboard into code or config, multiline text often needs to be flattened first.
registers #registers #insert-mode #expression-register #text-processing
>G
The >G command applies a right-indent shift to every line from the cursor through the last line of the buffer.
*NgUgn
gn is often treated as a visual selection command, but it is more powerful when used as a motion target for operators.
:'<,'>normal! I//
Visual Block insert (I.
<C-w>z or :pclose
The preview window shows file contents temporarily without switching your editing context.
buffers-windows #buffers-windows #quickfix #preview #navigation
:%s/\n\{3,}/\r\r/g
When files pass through formatters, generators, or repeated edits, they often accumulate noisy vertical gaps.
/\%>80v\S
When you enforce line-length limits, visual guides show where the boundary is, but they do not help you jump directly to violations.
:let @+=@%
The % register always holds the name of the current file (as a relative path).
@='A;<Esc>'<CR>
Recorded macros are powerful, but sometimes you need a quick ephemeral sequence and do not want to occupy a register.
:{range}center {width}
Vim has built-in Ex commands for text alignment: :center, :right, and :left.
command-line #ex-commands #formatting #editing #command-line
qa...@aq
A recursive macro calls itself at the end of its recording, causing it to repeat until a motion or search fails.