How do I paste text and automatically adjust its indentation?
]p
The ]p command pastes text and adjusts its indentation to match the current line.
]p
The ]p command pastes text and adjusts its indentation to match the current line.
ciw + new text + Esc, then n.
The ciw command followed by new text, combined with and .
ci`
The ` ci ` command changes the text inside backtick delimiters.
<C-w>H
The H command moves the current window to the far left, making it a full-height vertical split.
<C-w>p
The p command jumps to the previously active window (the last window you were in).
<C-w>r
The r command rotates windows in the current row or column.
gt and gT
The gt command moves to the next tab page and gT moves to the previous one.
<C-w>> and <C-w><
The > and > increases width by 1 column > increases width by 10 columns maximizes the window width Example With a vertical split, 20> gives the current window 2
"+y and "+p
The "+ register is linked to the system clipboard.
q{a-z}...q
Recording a macro captures a sequence of keystrokes into a register, which you can replay later.
qa ci"replacement<Esc> /next<CR> q
Macros can contain any Vim command including text objects, searches, and multi-key motions.
"1p through "9p
Registers 1-9 contain the last 9 deletions or changes that are at least one line long.
qa ... j@bj q
You can create macros that call other macros, applying different operations to alternate lines or creating complex editing patterns.
".
The .
"=2+3<CR>p
The expression register = evaluates a Vimscript expression and stores the result.
v
The v command enters character-wise visual mode, letting you select text one character at a time.
y$
The y$ command yanks (copies) text from the cursor position to the end of the line.
ddp
The ddp sequence swaps the current line with the line below it.
<C-a>
The command increments the number under or after the cursor by 1.
X
The X command deletes the character to the left of the cursor (before it).