Skip to main content

Module hooks

Module hooks 

Source
Expand description

Limited plugin hooks — run shell commands on editor events.

Config: ~/.xei/hooks.toml

# Placeholders: {file} {path} {dir} {ext} {event}  (shell-quoted automatically)
on_save = "echo saved {file}"
on_open = ""
on_quit = ""
enabled = true

Multiple commands: separate with ;; (each runs sequentially). Hooks run on a background thread (the editor never blocks); each command is killed after 10s. on_quit is fire-and-forget so quitting stays instant.

Structs§

HooksConfig

Enums§

HookEvent

Functions§

run_hooks
Run hook commands, waiting up to [HOOK_TIMEOUT] each. Returns the last status line. Blocking — call from a background thread.
run_hooks_detached
Fire-and-forget: spawn commands without waiting, so quit stays instant. The children keep running after the editor exits.