The extension mechanism is not via plug-ins, see https://github.com/mawww/kakoune/blob/master/doc/manpages/faq.asciidoc#why-arent-there-other-scopes-similar-to-sh-eg-python- (maybe you can find more discussion in the issue tracker but I'm not sure).
If I understand this correctly, pareinfer is ported ad hoc for every editor. We would need it as an external standalone component, with various amounts of glue to make it work with kakoune.
We would need it as an external standalone component, with various amounts of glue to make it work with kakoune
I think something like this might already be possible. I believe vim-parinfer was using the Node version of parinfer via some kind of JSON api before it switched to using parinfer written in vimscript. What kind of glue is supported? Can I run a curl command to a local server and get its output into the kakoune buffer? (sorry still reading through the readme, but sounds like this might be possible)
For 'glue' I mean the kakoune 'scripting language' (which is no different from the commands that you can use while editing). In particular, the %sh{ } block is used to spawn an external shell: usually the output of the command processed into kakoune commands that will then be executed via :exec or :eval
Ooh exec looks pretty interesting. I'll read up some more. Thanks!
Question: can something like exec be executed in insert mode?
Look at hooks, there are a couple of them for character insertion and key "insertion", that's probably what you are looking for.
Implementing parinfer using an external tool should definitely be doable with the current infrastructure. Closing this.
This issue is closed, but some info:
The parinfer-rust port (which I maintain) is now usable as a normal filter which can be called with %|parinfer-rust -mi<ret> (or -mp for paren mode). https://github.com/eraserhd/parinfer-rust
Smart mode needs a bunch more information which can be sent with the JSON interface. I hope to have a parinfer.kak that does this real-time in the near future (but I'm going to fix the lisp/clojure indent hook first).
Most helpful comment
Look at hooks, there are a couple of them for character insertion and key "insertion", that's probably what you are looking for.