defaultCommands
defaultCommands(
selfClosePairs,selfCloseRegex):BasicExtension
Defined in: extensions/commands.ts:64
Extension that will add automatic indentation and closing of brackets, quotes, and tags along with the commands presented later.
The shortcuts for the commands are not easily customizable. If you want to customize them, you can copy the https://github.com/jonpyt/prism-code-editor/blob/main/package/src/extensions/commands.ts|source and change the conditions.
Commands
Section titled “Commands”Here, Mod refers to Cmd on Mac and Ctrl otherwise.
Alt+ArrowUp: Move line upAlt+ArrowDown: Move line downCtrl+ArrowUp: Scroll one line up (Windows/Linux only)Ctrl+ArrowDown: Scroll one line down (Windows/Linux only)Shift+Alt+ArrowUp: Copy line upShift+Alt+ArrowDown: Copy line downMod+Enter: Insert blank lineMod+]: Indent lineMod+[: Outdent lineTab: Indent line (Tab capture enabled)Shift+Tab: Outdent line (Tab capture enabled)Shift+Mod+K: Delete lineMod+/: Toggle commentShift+Alt+A: Toggle block commentCtrl+M: Toggle tab capturing (Windows/Linux)Ctrl+Shift+M: Toggle tab capturing (Mac)
Parameters
Section titled “Parameters”selfClosePairs
Section titled “selfClosePairs”string[] = ...
Pairs of self-closing brackets and quotes.
Must be an array of strings with 2 characters each.
Defaults to ['""', "''", '``', '()', '[]', '{}'].
selfCloseRegex
Section titled “selfCloseRegex”RegExp = ...
Regex controlling whether or not a bracket/quote should
automatically close based on the character before and after the cursor.
Defaults to /([^$\w'"`]["'`]|.[[({])[.,:;\])}>\s]|.[[({]`/s.