How do I insert the same text multiple times without a macro or copy-paste?
80i-<Esc>
Vim's insert commands accept a count prefix that repeats everything you type.
80i-<Esc>
Vim's insert commands accept a count prefix that repeats everything you type.
<C-a> (in insert mode)
While in insert mode, pressing re-inserts whatever text you typed during your previous insert session.
<C-y> / <C-e>
When typing in insert mode, you can pull individual characters from adjacent lines without leaving insert mode.
<C-t> and <C-d> in insert mode
When typing in insert mode, you can adjust the current line's indentation without leaving to normal mode.
<C-t> and <C-d>
When you're typing in insert mode and realize the current line needs more or less indentation, you don't have to leave insert mode to fix it.
zf{motion}
Vim supports several fold methods, but manual folding with zf gives you precise control over exactly which lines to collapse.
:lockmarks
Many Ex commands silently adjust or delete marks as a side effect of modifying buffer content.
<C-o> (in insert mode)
Pressing while in insert mode drops you into a special "insert-normal" mode where you can execute exactly one normal mode command, then immediately return to in
<C-o>{command}
While typing in insert mode, you sometimes need to do a quick normal-mode action — center the screen, jump to a mark, or delete a word backward.
:%!xxd
Vim can serve as a hex editor by piping buffer contents through xxd, a hex dump utility that ships with Vim.
gqap
The gq operator reformats text by wrapping lines to fit within the textwidth setting.
:move +1 / :move -2
The :move command relocates lines to a specific position without using delete and paste.
:%norm A;
The :%norm command runs normal mode commands on every line in the file (or a range).
:read !date
The :read !{command} syntax runs a shell command and inserts its output below the current line.
:%!tac
Vim doesn't have a built-in reverse command, but you can pipe the buffer through tac (reverse of cat) to flip line order.
:center 80
Vim has built-in text alignment commands that adjust lines relative to a specified width.
cia (with targets.vim) or daa
While Vim doesn't have a built-in argument text object, the targets.
<C-k>DG
Vim's digraph system lets you insert special characters by pressing followed by a two-character mnemonic code.
<C-r>=2+2<CR>
The expression register (=) in insert mode lets you evaluate any Vimscript expression and insert the result inline.
g<C-a> in visual mode
When you have multiple lines with the same number and want to turn them into a sequence (1, 2, 3.