Skip to content

master-key.record ​

DEPRECATED: this is command now redundant, as users can define their own record flag using [[define]], master-key.setValue and mode.displayName to replicate the exact behavior of master-key.record.

master-key.record Turns a recording marker on or off. Note that all commands are always recorded, regardless of this value. This flag is to make it easy to select past history, by looking for master-key.record entries in the command history.

Furthermore, when record is on, Master Key will change the status bar mode to signal that keys are being recorded.

Arguments

  • on: boolean indicating if the recording flag should be set on (true) or off (false).

Example ​

Larkin uses the record flag to store command sequences for future replay.

toml
[[bind]]
defaults = "edit.action.history"
name = "record"
description = "Start/stop recording Master Key commands"
key = "shift+q"
when = "!master-key.record"
command = "master-key.record"
args.on = true

[[bind]]
defaults = "edit.action.history"
name = "record"
description = """
Start/stop recording key presses defined by Master Key pushing it to the
top of the `history` stack once recording finishes."
"""
key = "shift+q"
when = "master-key.record"
command = "runCommands"

[[bind.args.commands]]
command = "master-key.record"
args.on = false

[[bind.args.commands]]
command = "master-key.pushHistoryToStack"
args.range.from = '{{last_history_index(|i| history[i-1]?.doc?.name == "record")}}'
args.range.to = '{{history.len()-1}}'