Basics Flashcards
Save and quit
ZZ
Revert to last saved version
:e!
Quit and don’t save
:q!
Left one space
h
Down one line
j
Up one line
k
Right one space
l
Display line numbers
:set nu
Don’t display line numbers
:set nu!
Insert space at 10 chars from right margin
:set wm=10
Beginning of line
0
End of line
$
Move forward by word, counting symbols
w
Move forward by word, not counting symbols
W
Move backward by word, counting symbols
b
Move backward by word, not counting symbols
B
Change to the end of the word
cw
Change back 2 words
c2b
Change to the end of the line
c$
Change to the beginning of the line
c0
Replace one character
r
Go into overstrike mode
R
Change entire line
S
Change 3 entire lines
3S
Chase case of character under the cursor
~
Change the case of 5 characters
5~
Delete word
dw
Delete from cursor to the end of the line
D
Delete the character under the cursor
x
Undo last command
u
Restore line before any changes
U
Insert
i
Append
a
Append text to end of current line
A
Insert text at the beginning of the current line.
I
Delete character at cursor and substitute text.
s
Delete line and substitute text.
S
Open blank line below cursor for text
o
Open blank line above cursor for text
O
Join current line with line below
J
To first character of next line
+
To first character of previous line
-
To end of word
e or E
Repeat last action
.
Transpose two letters
xp
Put last deleted thing into the buffer after the cursor
p
Put last deleted thing into the buffer before the cursor
P
Copy word to buffer
yw
Copy line to buffer
yy or Y