Vi(m) Editor Flashcards
The three vi editor modes
command mode, insert mode, and ex mode
In command mode, this is how you move the cursor one character to the right.
l (lowercase L)
In command mode, this is how you move the cursor one character to the left.
h
In command mode, this is how you move the cursor down one line.
j (lowercase)
In command mode, this is how you move the cursor up one line.
k (lowercase)
It means to yank in the vi editor
“Copy (yank) a line”
In command mode, this is how you copy an entire line that the cursor is currently on.
yy
In command mode, this is how you copy the current line that the cursor is on, as well as the line beneath the current line (2 lines total).
2yy
In command mode, this is how you copy the current line and a certain amount of additional lines.
yy, where # includes the current line and however many other lines wished to be copied.
In command mode, this is how you paste the contents from a yank/copy, pasting it on the line after your cursor.
p (lowercase)
In command mode, this is how you paste the contents from a yank/copy, pasting it on the line before your cursor.
P (uppercase)
In command mode, this is how you move the cursor to a specific line #.
G or #gg
In command mode, this is how you move the cursor to the beginning of the last line in the file.
G
In command mode, this is how you move the cursor to the first line on the terminal screen.
1G
In command mode, this is how you move the cursor to the last line on the terminal screen.
L
In command mode, this is how you move the cursor to the first line on the terminal screen.
H
In command mode, this is how you start insert mode and create a new line below the current cursor position, using one command.
o (lowercase O)
In command mode, this is how you undo movement or yanks or any command entered in command mode.
u (lowercase u)