How do I insert the contents of another file into the current buffer?
:r filename
The :r filename command reads the contents of filename and inserts them into the current buffer below the cursor line.
:r filename
The :r filename command reads the contents of filename and inserts them into the current buffer below the cursor line.
<C-r>
The (Ctrl+r) command redoes the last change that was undone with u.
gqip
The gqip command reformats the current paragraph to fit within the configured textwidth.
r{char}
The r{char} command replaces the character under the cursor with {char} without ever entering insert mode.
10@a
The 10@a command replays the macro recorded in register a exactly 10 times.
gv
The gv command reselects the exact same area that was last selected in visual mode.
:'<,'>normal @a
The :'normal @a command executes the macro stored in register a on every line within the current visual selection.
:!command
The :!command syntax lets you execute any shell command directly from within Vim without leaving the editor.
:s/old/new/g
The :s/old/new/g command replaces all occurrences of old with new on the current line only.
O
The O (uppercase) command opens a new blank line above the current line and places you in insert mode, ready to type.
o
The o command opens a new line below the current line and places you in insert mode, ready to type.
P
The P (uppercase) command pastes the contents of the default register before the cursor position.
p
The p command pastes (puts) the contents of the default register after the cursor.
"+p
The "+p command pastes the contents of the system clipboard into Vim.
>>
The >> command shifts the current line one shiftwidth to the right, adding indentation.
I
The I (uppercase) command moves the cursor to the first non-blank character of the current line and enters insert mode.
:r !command
The :r !command command executes a shell command and inserts its output directly into the current buffer below the cursor line.
J
The J command joins the current line with the line below it, replacing the newline with a space.
`.
The ` .
guiw
The guiw command converts the entire word under the cursor to lowercase.