<newbie> ELI5 how integration with shell works

The key to grokening is to understand that kak manage subprocesses (POSIX sh processes) and has way of communicating by e.g. setting environment variables in such subprocess; most notably when you … %sh{…}. You can communicate back with e.g. kak -p or more comfortably for simple cases with :eval %sh{…}.

The previous paragraph assume prerequisites: familiar with UNIXes, reading :doc execeval :doc expansions.

I suggest to use plugins you mention only if it bring immediate positive result without too much configuration. You will not be able to integrate them elegantly with your other UNIX tools and setting|getting from Kakoune client|session in general if you do not understand Kakoune architecture, which is a bit more complicated (client/server) than I vaguely described.

Another advice as learning exercise is to try to pass simple message between Kakoune and an executable with :eval %sh{…}, e.g. try to do arithmetics by calling python or lua or bc on selection content ($kak_selection) and pass the result back to Kakoune with printf in the %sh{…} block.

You should use search feature of this forum for particular goal. One of your question is basically format-on-write and has been answered in multiple threads, see :doc hooks, and for “simple” integration with linters/formatters, see the wiki

for other tutorials, see Intro to Kakoune … articles, and in particular Languages · mawww/kakoune Wiki · GitHub

have courage, it’s worth it.

4 Likes