How do I copy a line to another location without using yank and paste?
:t {address}
How it works The :t command (short for :copy) copies one or more lines and places them below the specified address.
:t {address}
How it works The :t command (short for :copy) copies one or more lines and places them below the specified address.
:retab
How it works The :retab command replaces all tab characters in the current buffer with the appropriate number of spaces, based on your current tabstop and expan
yiw
How it works The command yiw yanks (copies) the inner word under the cursor.
=i{ or =ap
The = operator performs smart indentation based on Vim's filetype-aware indent rules.
:%s/,/\r/g
In Vim's substitute command, \r in the replacement string inserts a newline.
<C-v>u{code}
In insert mode, followed by u and a 4-digit hex code inserts the Unicode character with that code point.
<C-h> / <C-w> / <C-u>
Vim provides three levels of deletion directly in insert mode, so you don't need to switch to normal mode for small corrections.
gU{motion} / gu{motion} / g~{motion}
Vim has three case operators that work with any motion or text object: gU for uppercase, gu for lowercase, and g~ for toggle case.
editing #editing #case #operators #text-objects #normal-mode
ggVG
While Vim doesn't have a built-in "entire buffer" text object, the ggVG sequence achieves it: go to the first line, enter line-wise visual mode, then select to
:earlier 5m
Vim's :earlier and :later commands let you travel through your undo history using time-based offsets — not just individual changes.
<C-x><C-o>
The keystroke triggers omni completion, Vim's built-in language-aware completion system.
<C-r><C-o>"
The {register} sequence in insert mode pastes register contents literally — without triggering auto-indentation, abbreviations, or mappings.
gJ
The gJ command joins the current line with the line below it without inserting any space between them.
<C-a> / <C-x>
Pressing increments and decrements the number under or after the cursor.
ga
The ga command displays the ASCII/Unicode value of the character under the cursor in decimal, hexadecimal, and octal.
editing #editing #unicode #debugging #normal-mode #inspection
ci" / ci( / ci{ / ci[ / ci` / ci'
The ci{delimiter} family of commands changes the text inside any matching pair of delimiters.
editing #editing #text-objects #change #delimiters #normal-mode
d2i(
Vim text objects accept a count prefix that lets you target outer layers of nested delimiters.
d<C-v>2j
Vim lets you override the natural type of any motion by pressing v, V, or between the operator and the motion.
editing #editing #motions #visual-mode #advanced #normal-mode
ciw""<Esc>P
Vim doesn't have a built-in "surround" operator, but you can wrap any word in quotes or brackets with a short sequence: ciw""P.
editing #editing #text-objects #normal-mode #productivity #surround
g~iw
The g~iw command toggles the case of every character in the word under the cursor — uppercase letters become lowercase and vice versa.