Autoload directory disables doc command

The basic kakoune installation has a functioning :doc command.
However, when I create the directory ~/.config/kak/autoload/ I get the error no such command: 'doc'.

I’m wondering why this is and what I’m missing.

I just started slowly learning both vim and kakoune (I see why the editing grammar of kakoune is better). I created the autoload directory following the instructions to install this: https://github.com/alexherbo2/search-highlighter.kak hoping to get functionality similar to hlsearch in vim.

Off topic but I found the basic documentation for highlighters to be a little opaque; hopefully it will make more sense as I learn more.

The reason this happens is because when the autoload directory is absent, Kakoune loads the files in the …/share/kak directory relative to the binary, which contains the functionality for the doc command you speak of, among other things. If the autoload directory is present, however, it doesn’t do this, which causes the errors you’re seeing. This allows the user to pick and choose which scripts to load.

The fix, then, is to copy all the default script files to the autoload directory. This is done by finding the kak binary, and copying all the files in the …/share/kak directory to your autoload.

I hope this makes sense, and let us know if you have any more questions.

You don’t have to copy all the files, you can just make a symlink to %val{runtime}/autoload. The wiki page on installing plugins has a Kakoune command that will create the autoload directory and hook up the symlink.

2 Likes

Ah, right. I forgot all about symlinks. That would indeed be an easier way to go about it.