# Cursor moving h - move left j - move down k - move up l - move right ctrl-b - page up ctrl-f - page down % - jump to matching brace w - jump by start of words (punctuation considered words) W - jump by words (spaces separate words) e - jump to end of words (punctuation considered words) E - jump to end of words (no punctuation) b - jump backward by words (punctuation considered words) B - jump backward by words (no punctuation) ge - jump backward to end of words (punctuation considered words) gE - jump backward to end of words (no punctuation) 0 - (zero) start of line ^ - first non-blank character of line $ - end of line _ move to first non-blank character of the line g_ move to last non-blank character of the line gg - Go to first line [N]G - Go To line N. No N: last line Note: Prefix a cursor movement command with a number to repeat it. For example, 4j moves down 4 lines. # Inserting/Appending text i - start insert mode at cursor I - insert at the beginning of the line a - append after the cursor A - append at the end of the line o - open (append) blank line below current line (no need to press return) O - open blank line above current line ea - append at end of word Esc - exit insert mode # Editing r - replace a single character (does not use insert mode) J - join line below to the current one cc - change (replace) an entire line cw - change (replace) to the end of word c$ - change (replace) to the end of line s - delete character at cursor and subsitute text S - delete line at cursor and substitute text (same as cc) xp - transpose two letters (delete and paste, technically) u - undo ctrl-r - redo . - repeat last command ~ - switch case g~iw - switch case of current word gUiw - make current word uppercase guiw - make current word lowercase >> - indent line one column to right << - indet line one column to left == - auto-indent current line ddp - swap current line with next ddkP - swap current line with previous gg=G - Format all code