Editor Shortcuts
The HaasOnline code editor supports a wide range of keyboard shortcuts that speed up script development. The editor is based on Monaco (the same engine behind VS Code), so many shortcuts will feel familiar if you have used VS Code before.
Command Palette
Press F1 to open the command palette. This lets you search for and execute any editor action by typing its name, even if you do not remember the keybinding.
Essential Shortcuts
These are the shortcuts you will use most often while writing HaasScript scripts. Learn these first.
| Action |
Keybinding |
| Command Palette |
F1 |
| Autocomplete / Suggestions |
Ctrl+Space |
| Parameter Hints |
Ctrl+Shift+Space |
| Go to Line |
Ctrl+G |
| Find |
Ctrl+F |
| Find and Replace |
Ctrl+H |
| Toggle Line Comment |
Ctrl+/ |
| Insert Line Below |
Ctrl+Enter |
| Insert Line Above |
Ctrl+Shift+Enter |
| Delete Line |
Ctrl+Shift+K |
| Move Line Up |
Alt+UpArrow |
| Move Line Down |
Alt+DownArrow |
| Copy Line Up |
Ctrl+Shift+Alt+UpArrow |
| Copy Line Down |
Ctrl+Shift+Alt+DownArrow |
Multiple Cursors
Multiple cursors let you edit several lines at once -- useful for renaming variables or adjusting input parameter defaults across your script.
| Action |
Keybinding |
| Add Cursor Above |
Shift+Alt+UpArrow |
| Add Cursor Below |
Shift+Alt+DownArrow |
| Add Cursors to All Line Ends |
Shift+Alt+I |
| Select All Occurrences of Find Match |
Ctrl+Shift+L |
| Add Selection to Next Find Match |
Ctrl+D |
Selection
| Action |
Keybinding |
| Expand Selection |
Shift+Alt+RightArrow |
| Shrink Selection |
Shift+Alt+LeftArrow |
| Select to Bracket |
Ctrl+Shift+\
|
| Go to Matching Bracket |
Ctrl+Shift+\
|
Code Folding
Code folding collapses sections of your script so you can focus on the parts you are working on. This pairs well with the section-comment technique described in Using Comments.
| Action |
Keybinding |
| Toggle Fold |
Ctrl+K Ctrl+L |
| Fold |
Ctrl+Shift+[
|
| Unfold |
Ctrl+Shift+]
|
| Fold Recursively |
Ctrl+K Ctrl+[
|
| Unfold Recursively |
Ctrl+K Ctrl+]
|
| Fold All |
Ctrl+K Ctrl+0 |
| Unfold All |
Ctrl+K Ctrl+J |
| Fold All Block Comments |
Ctrl+K Ctrl+/ |
| Fold All Regions |
Ctrl+K Ctrl+8 |
| Unfold All Regions |
Ctrl+K Ctrl+9 |
Folding by Level
Use these to fold code to a specific indentation depth. Level 1 folds top-level blocks, level 2 also folds nested blocks, and so on.
| Action |
Keybinding |
| Fold Level 1 |
Ctrl+K Ctrl+1 |
| Fold Level 2 |
Ctrl+K Ctrl+2 |
| Fold Level 3 |
Ctrl+K Ctrl+3 |
| Fold Level 4 |
Ctrl+K Ctrl+4 |
| Fold Level 5 |
Ctrl+K Ctrl+5 |
| Fold Level 6 |
Ctrl+K Ctrl+6 |
| Fold Level 7 |
Ctrl+K Ctrl+7 |
Search
| Action |
Keybinding |
| Find |
Ctrl+F |
| Replace |
Ctrl+H |
| Find Next |
Enter |
| Find Previous |
Shift+Enter |
| Find Next Selection |
Ctrl+F3 |
| Find Previous Selection |
Ctrl+Shift+F3 |
Navigation
| Action |
Keybinding |
| Go to Line |
Ctrl+G |
| Go to Next Problem (Error, Warning) |
Alt+F8 |
| Go to Previous Problem (Error, Warning) |
Shift+Alt+F8 |
| Go to Next Problem in Files |
F8 |
| Go to Previous Problem in Files |
Shift+F8 |
| Open Custom Command |
F12 |
Indentation
| Action |
Keybinding |
| Indent Line |
Ctrl+]
|
| Outdent Line |
Ctrl+[
|
Comments
| Action |
Keybinding |
| Toggle Line Comment |
Ctrl+/ |
| Toggle Block Comment |
Ctrl+Shift+A |
| Add Line Comment |
Ctrl+K Ctrl+C |
| Remove Line Comment |
Ctrl+K Ctrl+U |
Other Shortcuts
| Action |
Keybinding |
| Cursor Undo |
Ctrl+U |
| Undo Last Cursor Placement |
Ctrl+U |
| Trim Trailing Whitespace |
Ctrl+K Ctrl+X |
| Trigger Suggest |
Ctrl+Space |
| Show Hover |
Ctrl+K Ctrl+I |
| Move Last Selection to Next Find Match |
Ctrl+K Ctrl+D |
| Replace with Next Value |
Ctrl+Shift+. |
| Replace with Previous Value |
Ctrl+Shift+, |
| Show Editor Context Menu |
Shift+F10 |