How do I indent a line in Vim?
>>
The >> command shifts the current line one shiftwidth to the right, adding indentation.
953 results for ":normal"
>>
The >> command shifts the current line one shiftwidth to the right, adding indentation.
d2i(
Vim text objects accept a count prefix that lets you target outer layers of nested delimiters.
"1p through "9p
Registers 1-9 contain the last 9 deletions or changes that are at least one line long.
guiw
The guiw command converts the entire word under the cursor to lowercase.
gUiw
The gUiw command converts the entire word under the cursor to uppercase.
J
The J command joins the current line with the line below it, replacing the newline with a space.
gJ
The gJ command joins the current line with the line below it without inserting any space between them.
:%!command
:%!{command} replaces the entire buffer contents with the output of piping them through a shell command.
{count}r{char}
The {count}r{char} command replaces a precise number of characters starting at the cursor position with a single repeated character.
dd
The dd command deletes the entire current line, regardless of where the cursor is positioned on that line.
U
In visual mode, pressing U converts all selected characters to uppercase and u converts them to lowercase.
/pattern\ze followed
The \ze atom marks the end of the match, so you can match a pattern only when it appears before specific text.
gR
gR enters Virtual Replace mode, a smarter variant of Replace mode (R) that replaces characters based on screen columns rather than raw bytes.
<C-c>
exits insert mode immediately but silently skips two important side effects that (and its equivalent ) always trigger: abbreviation expansion and InsertLeave au
<C-r>
The (Ctrl+r) command redoes the last change that was undone with u.
//
In Vim, pressing // (two forward slashes) in Normal mode repeats the last search pattern.
D
The D command deletes everything from the cursor position to the end of the current line.
/TODO/e
Most users know /pattern, but fewer use search offsets to control where the cursor lands after the match.
:set nrformats+=bin
Vim's and commands increment and decrement numbers under the cursor, but by default they only handle decimal and hexadecimal.
qa ci"replacement<Esc> /next<CR> q
Macros can contain any Vim command including text objects, searches, and multi-key motions.