Expressions
There are a number of places where you can use expressions when defining a keybinding. Any field that is evaluated as an expression includes the word computed
in its name. The expressions are AngularJS expressions. When an expression is evaluated the following values are in scope:
- Any field defined in the top-level
define
field - Any value set by
setFlag
editorHasSelection
: true if there is any selection, false otherwiseeditorHasMultipleSelections
: true if there are multiple selections, false otherwisefirstSelectionOrWord
: the first selection, or the word under the first cursor if the selection is emptyeditorLangId
: the language id of the current editor or the empty string if there is no current editor (or no language id for that editor)mode
: the current keybinding modecount
: The current count, as defined bymaster-key.updateCount
captured
: The text currently captured by the most recent call tomaster-key.restoreNamed
ormaster-key.captureKeys
.prefix
: The currently active keybinding prefixrecord
: a boolean flag used to indicate when keys are marked for recordingcommandHistory
: an array containing all previously run master key commands, up to the number configured by Master Key's "Command History Maximum" (defaults to 1024). Commands are stored from least recent (smallest index) to most recent (largest index).