openhab-docs/mainui/settings/script-editor.md

43 lines
1.5 KiB
Markdown

---
layout: documentation
title: Script Editor
---
# Script Editor
<!-- START MAINUI SIDEBAR DOC - DO NOT REMOVE -->
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.
## 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>Shift</kbd><kbd>K</kbd>: Delete the current line or selection.
- <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 -->