I present to you kak-plumb, an integration with the Plan 9 plumber via plan9port.
This delegates the opening of URLs to the Plan 9 plumber.
Yet to do:
Override the handling on the *grep* and *make* buffers to plumb errors.
Create a separate plugin for opening files that can be used by plumbing rules. It will have a configurable list of methods to try in order, including “existing-client”, “jumpclient”, “new-window”, “lru” - because I want my config to be 'existing-client' 'lru -count 4' 'new-window'.
I don’t have a lot yet, but I agree the possibilities are endless! I really only plumb web URLs at the moment, but here’s what I’m doing with them:
I have my MacBook and a beefy Linux server named crunch where I do most of my development and computing. I don’t have X or anything installed on crunch, I just run a tmux session there. I run the plumber on crunch, and 9 import it to my macbook so they both share the same plumber filesystem. I then run opener-daemon on my MacBook. This listens for messages on web and focuses an existing Chrome tab or creates a new one.
Now, if I plumb a URL from either machine, it will open in Chrome, and I won’t have duplicate tabs. I usually have Chrome visible on my laptop screen and tmux on my big monitor (connected to laptop), so I’ve written opener-daemon so that it won’t steal focus. (Actually, it still steals focus for about a quarter second, but then restores it. sigh)
(I’m considering a URL opener plugin for tmux. I’m not sure whether I want it, or a better way to find URLs in Kakoune, since I’m still using tmux-editor-copy-mode. Maybe just a plumb-url command with -menu completion taking URLs from the current buffer would be sufficient?)
This all needs a bit of polish. When crunch dies, I have to kill a bunch of things and restart them in a peculiar order.
It would be nice if I could configure Alacritty to open URLs by click by plumbing them.
In any case, this seemed like a nice way to do a small part of my long-standing idea with making a CodeBubbles-like environment for Kakoune. It means that Kakoune doesn’t have to know all about how to start different kinds of URLs and what not.
Ideas on what to plumb (not yet implemented):
Directories start a shell?
git URLs check out a project and open an editor session in a new tmux tab?
Clojure namespaces get mapped to the correct Clojure files in the project.
Clojure symbols get resolved and open the first line of the definition.
tmate SSH URLs start a tmate session?
files and file:line and file:line:column definitely get opened in Kakoune
man pages get opened in Kakoune
@user starts a private slack conversation with user? #channel opens channel in wee-slack?