Skip to main content

register_command

Function register_command 

Source
pub fn register_command(
    id: impl AsRef<str>,
    title: impl AsRef<str>,
    group: Option<&str>,
    keys: &[&str],
)
Expand description

Register a plugin command. It becomes runnable from the palette + optionally bound to one or more key chords in the host. Keyspec syntax mirrors mnml’s own keymap ("ctrl+shift+t", "<leader>xt", …).

group categorises the command in the palette ("plugin" by default). The registered command runs inside mnml — most siblings pair this with a toast or a fresh open-pty follow-up so the user sees the action.