editorCommands
editorCommands(
hotkeyMap,selfClosePairs,selfCloseRegex):BasicExtension
Defined in: extensions/commands/index.ts:32
Extension that will add automatic closing of brackets, quotes, and tags along with the specified commands.
Parameters
Section titled “Parameters”hotkeyMap
Section titled “hotkeyMap”Record<string, EditorHotkey>
Commands that will be added to the editor.
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.