The plugin has changed a lot in the lasts months, partly because it tries to solve new problems. It was necessary to improve the documentation to explain its power. You can check the changes in the repository.
In this post I will try to summarize the features connect.kak provides.
The objective of connect.kak is to synchronize external applications with Kakoune clients easily. A typical use case is opening a file browser and having it open the files in the Kakoune client. Another very typical use case is connecting a terminal.
connect.kak provides basic commands to interact with the connected client interactively or to write your own scripts (check
:batch, which is an integration crafted from the rest of the commands) as well as a set of officially supported modules (Kakoune commands to programs).
As stated, connect.kak is about linking or mutually controlling other programs and Kakoune clients (or sessions, actually). However, it’s more than that. connet.kak provides three different things: built in integrations (which can be used out of the box), a framework for developing for kakoune outside kakoune and extensions to your workflow. I will cover the three in the next posts.
Built in Integrations
- Pop up selection apps: dmenu, rofi and wofi
- Interactive filters: fzf
- File managers: nnn, broot and lf
And lots of applications don’t need anything special to work and can be spawned with
In addition, it allows you to connect your shell, which is very handy to edit new files, compile the current buffer, or similar actions.
If you want some of this features, connect.kak already provides a lot of value.
connect.kak as a framework
You can also define your own connect commands and aliases and locate them in a path set in the
connect_pathsoption. By default, it is set to your
connect.kak is extensible. It provides a set of basic commands that allow you to write scripts to interact with Kakoune saving a lot of effort.
Your own plugins can register commands and use connect.kak basic utilities if they interact with other applications. This is the reason connect.kak can act as a base framework.
connect.kak also provides a
.desktop entry to integrate Kakoune in your linux desktop (GNOME, KDE, etc).
Extending your workflow
connect.kak can improve your current workflow too.
For example, Kakoune can be suspended using
<c-z> to recover your terminal and execute other programs. With connect.kak, a typical workflow is working with a connected shell (started with
kak-shell or by detaching from a current session with
&) ). If you map
quit, you can easily detach and reattach (closing the current client), but also reattach from a different shell, reattach opening new files, reattach from a terminal file manager, etc. With barebones Kakoune you can also start a file manager and edit files with Kakoune, but then you enforce the stack
shell → file manager -> kakoune, and you also need to start the applications in that order. connect.kak makes that workflow simpler: switch applications however you like, launch application when you need them, control Kakoune where you need it.
kak-shell :attachlets your run a client connected to a session, just like
kak -c <session id>. But with
kak-shell :attachyou have a list of all the active sessions and you can also create a new named session which starts in headless mode, which is very useful for detaching and reattaching continually.
kak -c <session id>and
kak -d -s <session id>and can serve to spawn a client in whatever situation you are.
Tip : You can alias
kak-shellto something like
ks, and you’d only need to type