======================= MICRO EDITOR CHEATSHEET ======================= BASIC FILE ACTIONS ------------------ Open file from terminal: micro filename Save: Ctrl+S Quit: Ctrl+Q Save and quit: Ctrl+S, then Ctrl+Q Command prompt: Ctrl+E (type things like: quit, save, open filename) CURSOR MOVEMENT --------------- Arrow keys: Move cursor Start of line: Home or Alt+A End of line: End or Alt+E Move one word left/right: Alt+Left / Alt+Right Go to line #: Alt+G, then type the line number Start of file: Alt+G, then 1 End of file: Alt+G, then last line number EDITING TEXT ------------ Undo: Ctrl+Z Redo: Ctrl+Y Cut (selection or line): Ctrl+X Copy (selection or line): Ctrl+C Paste: Ctrl+V Delete previous word: Ctrl+Backspace Delete next word: Ctrl+Delete SELECTION --------- Start/stop selection: Ctrl+Space Select word under cursor: Alt+W Select current line: Alt+L Select all: Ctrl+A SEARCH & REPLACE ---------------- Find: Ctrl+F Find next: Ctrl+N Find previous: Ctrl+P Replace (basic flow): 1) Ctrl+F 2) Type text to find, Enter 3) Type replacement text, Enter 4) Follow prompts (replace, replace all, etc.) INDENT / OUTDENT ---------------- Indent line/selection: Tab Unindent line/selection: Shift+Tab MULTIPLE CURSORS (OPTIONAL) --------------------------- Add cursor above: Alt+Up Add cursor below: Alt+Down Add cursor on next match of current selection: Alt+N Skip next match: Alt+S Remove last added cursor: Alt+X Select all matches: (Select text) then Alt+A WINDOWS / SPLITS INSIDE MICRO ----------------------------- Open vertical split: Ctrl+E, then: vsplit filename Open horizontal split: Ctrl+E, then: hsplit filename Switch between splits: Ctrl+W, then arrow key Close current split: Ctrl+W, then Q