How do I append the same text to the end of several lines?
V select then :norm A text
Selecting lines and running :norm A text appends the same text to the end of every selected line.
V select then :norm A text
Selecting lines and running :norm A text appends the same text to the end of every selected line.
y$
The y$ command yanks (copies) text from the cursor position to the end of the line.
:earlier 10m
The :earlier command restores the buffer to its state at a specific time in the past.
:sort
The :sort command sorts lines in the current buffer or a specified range alphabetically.
ddp
The ddp sequence swaps the current line with the line below it.
:%s/\s\+$//
The :%s/\s\+$// command removes trailing whitespace (spaces and tabs) from every line in the file.
:m {line-number}
The :m (move) command moves the current line to after the specified line number.
<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).
dip
The dip command deletes the inner paragraph — all contiguous non-blank lines surrounding the cursor.
:t {line-number}
The :t (copy/transfer) command duplicates the current line and places it after the specified line number.
<C-x>
The command decrements the number under or after the cursor by 1.
ce
The ce command changes from the cursor position to the end of the current word.
==
The == command auto-indents the current line based on the surrounding context.
cc
The cc command deletes the entire content of the current line (preserving indentation) and enters insert mode.
:%normal command
The :normal command executes normal mode commands programmatically on a range of lines.
:{line}put {register}
How it works The :put Ex command pastes the contents of a register after a specified line.
:%s/\<word\>/replacement/g
How it works In Vim's regular expressions, \ are word boundary anchors: \ matches the end of a word.
:iabbrev {abbr} {expansion}
How it works The :iabbrev command creates abbreviations that automatically expand when you type them in insert mode.
:m {address}
How it works The :m command (short for :move) moves one or more lines to after the specified address.