Skip to content

Commit

Permalink
Update Main UI script editor docs (openhab#2232)
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 authored Feb 10, 2024
1 parent 3fcde6c commit da2df85
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions mainui/settings/script-editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,34 @@ title: Script Editor
The script editor is used everywhere in the UI where some type of configuration file or source code has to be edited.
It provides syntax highlighting and auto-completion for code and Item names for multiple languages.

When using the script editor, you might find the following shortcuts useful:
## Keyboard Shortcuts

The following is a short overview of the most important keyboard shortcuts.
For a full list of available keyboard shortcuts, read the [CodeMirror docs](https://codemirror.net/5/doc/manual.html#commands).

Mac users should use <kbd>Cmd</kbd> instead of <kbd>Ctrl</kbd> for most shortcuts.

Autocompletion & Help:

- <kbd>Ctrl</kbd><kbd>Space</kbd>: Trigger auto-completion.
- <kbd>Ctrl</kbd><kbd>Q</kbd>: Show documentation (for JavaScript only).

Copy & Paste:

- <kbd>Ctrl</kbd><kbd>C</kbd>: Copy the current line or the current selection.
- <kbd>Ctrl</kbd><kbd>X</kbd>: Cut the current line or the current selection.
- <kbd>Ctrl</kbd><kbd>V</kbd>: Paste what has been copied.

Redo & Undo:

- <kbd>Ctrl</kbd><kbd>Z</kbd>: Undo the last change.
- <kbd>Ctrl</kbd><kbd>Y</kbd>: Redo the last change.

Other:

- <kbd>Tab</kbd>: Indent more.
- <kbd>Shift</kbd><kbd>Tab</kbd>: Indent less.
- <kbd>Ctrl</kbd><kbd>/</kbd> & <kbd>Cmd</kbd><kbd>/</kbd>: Comment/Uncomment the current line.
- <kbd>Ctrl</kbd><kbd>D</kbd>: Delete the current line.
- <kbd>Ctrl</kbd><kbd>/</kbd>: Comment/Uncomment the current line.
- <kbd>Ctrl</kbd><kbd>A</kbd>: Select all.
<!-- END MAINUI SIDEBAR DOC - DO NOT REMOVE -->

0 comments on commit da2df85

Please sign in to comment.