Godot - Kakoune integration

In the last couple of days, I put together this little plugin to prototype and develop Godot projects from Kakoune. We already got auto-completion with kak-lsp, but it’s a hassle to switch between coding in Kakoune and running projects from Godot.

What this plugin does is:

  • introduces the :godot path_to_scene_file command to run the given Godot scene file
  • and :godot-current that tries to find the scene file with the same name as the current buffer name and if it does it tries to open it with Godot.

That’s all :slight_smile:


Oh and by the way, does anyone know how can I get Kakoune to find the docs from plugins installed with plug.kak? So in my case I wrote godot.kak.asciidoc which would be located at $HOME/.config/kak/plugins/godot.kak/godot.kak.asciidoc after plugin installation.

But my understanding is that Kakoune only searches in $HOME/.config/kak/autoload for documentation :confused:

it also looks for other places as you can see in the link below, close to line 177, you could modify it or override it from your personal kakrc, or I guess symlinks could work too…

you will find in the tools dir a lot of things from which to take inspiration from.

1 Like

Yeah, but this means changing Kakoune’s source code. I’m interested in this change so users of plugins have an easy time “installing” the docs in an official way.

I guess I’ll have to submit a PR to add custom doc paths and see if it gets accepted.

As an alternative, you might consider patching plug.kak to install documentation in the places where Kakoune expects to find it.

1 Like

I saw a discussion about this in the plug.kak issue tracker or somewhere, but they couldn’t get a consensus on how to handle this on the plugin side cause there isn’t a specific plugin official folder layout or anything like that.

I think it’s better to add extra search paths in kakoune. I patched doc.kak on my end to do that, but I don’t know if that will ever be accepted in the app :slight_smile:

If there are others interested in the feature maybe with a few comments we can get it merged? Or if there’s a better idea I’m all ears.

1 Like

I mean, there is an official plugin folder layout, it’s “put all the files in the autoload directory”. plug.kak goes to a lot of effort to avoid that for .kak files, I’m sure they can figure out a way to avoid it (or automate it) for .asciidoc files too.

BTW @razcore-rad do you use kak-lsp with Godot? I found this configuration works for

filetypes = ["gd", "gdscript"]
roots = [".import", "project.godot"]
command = "nc"
args = ["localhost", "6008"]

Jump to definition on variable that is function argument works kinda wonky (jumps to end of funtion signature) but that might be an issue with Godot LSP implementation.

Sure, I use kak-lsp, but I don’t really use advanced features so I haven’t found any major issues with the Godot LSP. Let the kak-lsp peeps know about it, they fixed an issue I had with the Godot LSP real quick cause it was something that had to be configured on kak-lsp side. Include the debug log file and maybe you at least get an idea if it’s kak-lsp or Godot LSP.