APIs to create Slash Commands. For simple cases it is recommended to use Library/Std/Infrastructure/Slash Templates instead.
Define a custom slash command.
Supported keys in the spec:
name
: name of the commanddescription
: Description of the commandrun
: The callback function that will be invoked once the command is run.Example:
slashCommand.define {
name = "hello-world",
run = function()
editor.insertAtCursor("Hello |^| world!", false, true)
end
}