Announcing Kakoune Qt 🎉

Hello, Kakoune community :wave:

The past year, I have been working on Kakoune Qt: a Qt frontend for Kakoune. This project allows you to run a Qt-based program that looks and behaves like Kakoune running in the terminal.

Here are some additional features:

  • Create splits with :kakqt-split-horizontal and :kakqt-split-vertical
  • Focus splits with :kakqt-focus <client_name>
  • Show and hide clients with :kakqt-show <client_name> and :kakqt-hide <client_name>
  • Navigate between splits with keybindings <c-s-h>, <c-s-j>, <c-s-k> and <c-s-l>

Why use Kakoune Qt?

Right now, Kakoune Qt can’t boast of any real advantages over using Kakoune in the terminal with a terminal multiplexer. This project started because I wanted to use splits with Kakoune, but I don’t use a tiling window manager and I’m not a fan of tmux (fight me :boxing_glove:). There is still some work left for making Kakoune Qt on par with running Kakoune in the terminal. Notably, you can’t open another terminal application, such as bash, gdb or tig, in a split. I’m planning on adding that later.

However, I think that a GUI for Kakoune has a lot of potential. For example, there have been many attempts of implementing a buffer bar for Kakoune, but I’d argue that none are satisfactory. For a GUI, it would be quite easy to implement a VSCode-like buffer bar. A GUI would also allow for greater customization of Kakoune’s appearance. You could add nice borders, pixel-perfect padding, different font sizes for the code, status bar, menu and so on. Instead of having one status bar for each client, you could configure it to have one big status bar at the bottom of the window. A prompt that looks like VSCode could also be added as a styling option. Many possibilities that I’d like to experiment with in the future!

Kakoune Qt isn’t for everyone, but I’d appreciate if you’d try it out! Please report any bugs or problems you encounter while installing or using it :blush:

10 Likes

This is neat!

I once tried to do a similar thing with GTK. My motivation was adding clipboard integration, but since then Kakoune added the RegisterModified hook for Kakoune→system syncing, and bracketed-paste support for system→Kakoune syncing, so I never got around to fixing it.

The one thing I did rather like was text stretching/squishing. Kakoune has opinions about how wide each text span should be, which you need to respect in order to get things to lay out neatly, but that doesn’t necessarily coincide with the dimensions of the font you happen to be using. Terminal apps typically crop or pad the text to fit, which works but is clunky. I decided to scale the text instead, which has no visible effect most of the time, but if something was a bit wider or a bit narrower than Kakoune expected, it all still lined up. As a nice bonus, it also worked rather well with proportional fonts - a span like “iiiiiii” or “wwwwwww” might look a bit weird, but most of the time the unevenness of the spacing of the characters was spread out over the entire line, so subtly that you wouldn’t even notice.

1 Like

I like the idea. Please consider adding a file explorer and buffer list somewhere on the left/right sidebar.

Definitively something I’ll be adding in the future!