Useful vi commands
Only record some commonly used commands
Delete
delete one line
dd
delete one line from the current cursor
D
delete all from current cursor
dG
delete whole file
ggdG
gg means move cursor to the front
Undo
- Undo last thing you did
u
Search
Search forward
/
Search backward
?
Repeat last search in the same direction
n
Repeat last search in the opposite direction
N
Set raw number
set nu
Replacing all matching strings
g/search-string/s//replace-string/g