Now that OH3 Main UI has a Code editor for editing the Pages YAML, I am wondering if there’s an official list of keyboard shortcuts / shortcut keys for it.
The ones I know (due to similarities to VS Code) and I’m on OSX:
- Cmd+X and Cmd+C without a selection would cut / copy the current line
- Cmd+V paste
- Cmd+[ and Cmd+] Outdent and Indent (works on a selection too)
- Option+Shift then drag the mouse cursor vertically will create a vertical selection, the same as in VS Code. Very handy when inserting/deleting the same thing over multiple lines
I’m on Linux mostly so Cmd and Option are not a thing. Also, most of these are universal. You can use them in any text editor, MS Word, while composing an email, or what ever.
||What it does
||Cuts the selection, or the current line if no selection
||Copies the selection, or the current line if no selection
||Indent (shift right)
||Unindent (shift left)
|ALT-SHIFT-mouse drag or arrow keys
||Complete the current word or open a list of options to complete the current word of code
||Run the rule
||This may be a bug. It appears to delete the current line and also disable the Rule.
||Delete to the beginning of the word
||Delete to the end of the word
||Move cursor to the last line
The above are just the ones I use and remember off the top of my head. I’m sure there are more. The only one I’m missing is a key combo to comment/uncomment out a selection of lines. The usual ones don’t work in the browser. The other missing (or I don’t know it) one is to jump to a specific line number.
But again, almost all of these are universal. They are not specifically implemented by the code editor in the browser and can be used almost everywhere you edit text.
Thanks Rich. Indeed most are standard shortcut keys, but I learned a few new things from your list.
At the moment, I do this by doing a “zero column” vertical selection first - like you said above “block selection”
Sometimes I noticed the web based editor became very sluggish/slow too. Not sure why.