Already converted but needing a refresher? This is for you!
hands on the home rowasdfhjkl
3 modes, command mode (hit esc to return to it), insert mode (hit i to enter it) and visual mode (hit v to enter it)
hjkl move in command mode, h is left and moves left, l is right and moves right, j looks like a down arrow and moves down, k moves up.
w moves one word forward3w moves three words forward, b moves one word backward, 3b moves three words backwards
gg moves to beginning of file, G (this is shift-g) moves to end of file, number followed by shift-g moves to that line number 374(shift-g) will move to line 374
more on moving, 8k moves eight lines up, 5j moves five lines down, 4l moves four characters right, 23h moves 23 characters left
in command mode :w to save, :q to quit, :w! to overwrite, :q! to quit w/o saving, :wq to save and quit, :wq! to overwrite and quit, :e file to open "file"
!ignore any editor warnings
: opens command line which is used for many things other than just saving, opening and quitting
objects and actions: at beginning of word: d2w (action)(times)(object) (delete)(2)(words forward) this deletes including the trailing space need to leave it? use de this deletes one word and leaves the trailing space
d2b(delete)(2)(words backward)
hjkl are also objects! example: d3l(delete)(3)(left), for hl we count individual characters, not words, for jk we count individual lines, d3kdelete 4 lines up (3 plus current)
didn't catch why c and d ? look again d3w then check mode, ok, c3w, now check mode, yes, indeed
with all this power to change and delete you need u to undo and control-r to redo, infinitely
autocompletion: "whatchamacallit" need to type it again? wh(Control-p) will find previous word that starts with "wh" control-p control-n cycle through matches in (p)revious and (n)ext order
VISUAL MODE: v3w(visual select)(3)(words) repeat with b and hjkl
what to do with selection: y will "yank" (ie copy selection) p will "put" (ie insert) at new location, use y in visual mode and p in normal mode
more ways to enter insert mode: i a o I A O
iinsert at current location
ainsert after current location
oinsert line below current line
Iinsert AT START of current line
Ainsert AFTER END of current line
Oinsert line ABOVE current line.
convenience commands: dddelete current line, yyyank current line
Searching: /regularexpression to search forward, ?regularexpressionsearch backward
as before we can combine objects for more y/) will yank everything to NEXT parens (or whatever you search for) while y?) will yank everything up to the LAST parens