What I learned by vimtutor
.
Skip this. Use vimtutor
instead.
c [number] motion
0
Begin of line$
End of line
u
undoU
undo lineCTRL+r
redo
- Press
G
to move you to the bottom of the file. - Jump to line
123G
or:123
- Type gg to move you to the start of the file.
- To go back to where you came from press
CTRL-O
CTRL-I
goes forward.%
jumps between matching parentheses
- To search for a phrase in the backward direction, use
?
instead of/
.
:%s/old/new/gc
replace word in file with confirmation
:w FILENAME
writes the current file to diskv motion :w
FILENAME saves the Visually selected:r FILENAME
reads file and inserts it:r !dir
reads the output of the dir command
i
inserta
insert after cursorI
insert begin of lineA
insert end of line
r
one charR
replace multiple charsCtrl+j
remove line break
Jump in file aka Autojump ,,w
Select next occurence of word CTRL+n
Format code with ,p
or on save
Surround with parens eg. ysiW"
or ds"