Piped command information on file started from

That’s an open issue that only comes up seldomly. Not sure if we should change it.
A workaround is to use an option or a register as intermediary:

evaluate-commands -save-regs |a %{
  set-register a %arg{1}
  set-register | %{
      snip "$kak_reg_a"
  }
  [...]
}

You probably also want to define completions for your command, using something like

complete-command -menu snip shell-script-candidates %{
set -- $(snip --list-possible-arguments)
    printf '%s\n' "$@"
}

For even tighter integration, there are snippet plugins (like kak-lsp) that expose snippets as autocompletions. When a completion is accepted, the snippet is expanded. That’s a bit more involved but probably still well simpler than in other editors.

1 Like