Vim
Modes
Commmand Mode
- The mode that is started on launch
- From insert mode, press
esc to enter
- Commands are abbreviations
Insert Mode
- Press
i to enter insert mode from command mode
- Insert text like any other text editor
Commands
Meta
:q quit without saving
:w write current changes to file
:wq write to file and quit
:q! quit without saving
Text Editing
u undo last action (this can be used as many times as needed)
ctrl + r redo
dd cut (delete) a line of text
yy copy (AKA yank)
p paste/put
^ move cursor to the beginning of a line
H move cursor to top of screen
L move cursor to bottom of screen
Principles
- writing a number before a command will run that command that amount of times
2dd deletes two lines from cursor position
Cheatsheet
https://vim.rtorr.com/