# Beginner's Guide to Shortcuts and Formatting This is a short beginner's guide to the keyboard shortcuts available within the [decomp.me](https://decomp.me) code editor, as well as a quick reference guide for the colors and symbols used in code comparisons in the `Compilation` sandbox. ## Keyboard Shortcuts ### Cursor Movement | Keyboard shortcut | Description | | :--- | :--- | | Home | Move cursor to beginning of current line | | End | Move cursor to end of current line | | PgUp | Move cursor one screen up | | PgDn | Move cursor one screen down | | Ctrl+Home | Move cursor to beginning of file | | Ctrl+End | Move cursor to end of file | | Ctrl+Shift+\\ | Move cursor to matching bracket | ### Selection | Keyboard shortcut | Description | | :--- | :--- | | Shift+/ | Select backward/forward one character | | Ctrl+/ | Select backward/forward one 'word' | | Ctrl+L | Select current line | | Ctrl+A | Select all/entire file | ### Line Movement | Keyboard shortcut | Description | | :--- | :--- | | Enter/Shift+Enter | Insert new line (with auto indent) | | Alt+/ | Shift current line up/down | | Shift+Alt+/ | Duplicate current line up/down | | Ctrl+Shift+K | Delete current line | ### Undo, Redo, Delete | Keyboard shortcut | Description | | :--- | :--- | | Backspace/Del | Delete character to left/right | | Ctrl+Backspace/Del | Delete word to left/right | | Ctrl+Z | Undo last action | | Ctrl+Y (or Ctrl+Shift+Z) | Redo last action | | Ctrl+U | Undo selection | ### Formatting | Keyboard shortcut | Description | | :--- | :--- | | Tab (or Ctrl+\]) | Increase indent of cursor/selection | | Shift+Tab (or Ctrl+\[) | Decrease indent of cursor/selection | | Ctrl+K, Ctrl+C | Comment current line | | Ctrl+K, Ctrl+U | Uncomment current line | | Ctrl+\/ | Toggle line comments on selection | | Shift+Alt+A | Toggle block comments on selection | | Ctrl+Shift+\[ | Collapse code block at bracket | | Ctrl+Shift+\[ | Expand code block at bracket | | Ctrl+K, Ctrl+0 | Collapse all code blocks | | Ctrl+K, Ctrl+J | Expand all code blocks | ### Search and Replace | Keyboard shortcut | Description | | :--- | :--- | | Ctrl+G | Go to line... | | Ctrl+F | Open search and replace panel | | Esc | Close search and replace panel | | Alt+Enter | Select matches | | Ctrl+Alt+Enter | Replace all | | Ctrl+\/ | Toggle line comments on selection | | Ctrl+D | Select next occurrence | | Ctrl+Shift+L | Select all matches with current selection (multi edit)| ## Color and Symbol Guide decomp.me uses color and symbols to help make understanding the assembly code comparisons easier. - Branches (`~>`) are color-coded to form "from" and "to" pairs - Where code aligns **except for registers**, registers used in the same context are equivalently color-coded between `Target` and `Current` to help spot their usage - Specific types of differences between `Target` and `Current` assembly code are denoted with color and symbol: | Symbol | Color | Description | | --- | --- | --- | | (no symbol) | White | Match - lines are the same, up to constant naming | | `<` | Red | Deletion - line is present (in this spot) in `Target`, but not (in this spot) in `Current` | | `>` | Green | Insertion - line is present (in this spot) in `Current`, but not (in this spot) in `Target` | | `\|` | Blue | Change - line is a different instruction in `Target` and in `Current` | | `i` | Blue | Immediate difference - instruction matches, but numerical constants are different, or relocated | | `r` | Gold | Register Swap - at least one register used in this line does not match | | `s` | Yellow | Stack Difference - memory allocation does not match |