Vim CLI Basics =============== Startup vim: `vim filename.txt` Insert mode: `i` Command mode: `ESC` Navigation: `h`, `j`, `k`, `l` Move to next word: `w` (combine with number to skip words) Move to beginning of word: `b` (combine with number to skip words) Move to end of word: `e` (combine with number to skip words) Insert three dashes: `3i-` Jump to next dash: `f-` Jump to third dash: `3f-` Jump to next bracket: `%` Jump to beginning of line: `0` Jump to end of line: `$` Jump to next occurence of a word: `*` Jump to previous occurence of a word: `#` Jump to beginning of the file: `gg` Jump to end of the file: `G` Search word: `/` (Use `n` and `N` to navigate) Insert as new line: `o` and `O` Delete chars: `x` and `X` Replace char: `r` Cut text e.g. next word: `dw` (use `p` to paste in again) Undo: `u` Redo: `ctrl + r` Repeat last command: `.` Switch to visual editor: `v` Save changes: `:w` Quit Vim: `:q` Quit without saving: `:q!` Save and exit: `ESC` + `:x` Force quit (without saving): `ESC` + `:q!`