# Vim
# Shortcuts
Command Mode:
:q
- quit:w
- write the current state to the file:wq
- save and quit:q!
- quit without saving:set
number - turns on line numberingi
- Pressi
go enter Insert mode:%s/find/replace/
- Find and replace first occurrence. Replacefind
andreplace
accordingly.:%s/find/replace/g
- Find and replace greed mode, all occurrences.:%s/find/replace/gc
- Find and replace greed mode with confirmation to all occurrences.
Insert mode:
esc
- get back to command modedd
- delete a line2dd
- delete 2 line (if you put a number x before a command It will try to execute the command x times)u
- undo last actionctrl r
- redo/
- search (Type forward slash, and the subject you want to search) within the search pressn
to forward the search andN
to back. When you find typei
to edit.