Open.kak, a minimalistic way to browse directories

This week I started playing with Kakoune after many years of using (neo)vim. I dearly missed zooming around with vim-dirvish so I made: GitHub - lrworth/open.kak: Kakoune plugin to browse directories. · GitHub.

Blaze around your filesystem with <minus> and <ret>. No more being stuck in :e and fzf.

3 Likes

That looks pretty cool!

I notice that open-refresh-buffer is using the "o register as a temporary variable. Registers are shared across every client and buffer in the Kakoune session, so you might want to add -save-regs o to the enclosing evaluate-commands, so that refreshing a directory buffer doesn’t lose something somebody has stored there.

2 Likes

Very cool. You can easily add colors with kak-ansi

--- open2.kak	2026-07-26 11:36:03.460190341 +0300
+++ open.kak	2026-07-26 11:37:21.557388445 +0300
@@ -3,7 +3,9 @@
 define-command -hidden open-refresh-buffer %{
   evaluate-commands -save-regs o -draft %{
     execute-keys %{x"oy}
-    execute-keys %{%|ls -p "${kak_bufname}"<ret>}
+    execute-keys %{%|ls --color=always -p "${kak_bufname}"<ret>}
+    ansi-clear
+    ansi-render
     try %{
       execute-keys %{gg/^<c-r>o<ret>gi}
       set-option window open_selection %val{selections_desc}
@@ -31,6 +33,7 @@
       echo "${name}"
     }
     open-refresh-buffer
+    ansi-enable
     hook buffer WinDisplay .* open-refresh-buffer
     map buffer normal <c-l> %{: open-refresh-buffer<ret>}
     map buffer normal <ret> %{: open-current-line<ret>}
1 Like

Colouring is a great idea! But I don’t want to require kak-ansi so for now I’ve added a simple directory highlighter.