I've lost my syntax highlighting

Very recently, my syntax highlighting stopped working in Kakoune. Colorschemes are being applied, but source code is plain white text.

I’ve reinstalled by building from source. I have no kakrc, because I removed it to figure this out.

My kak runtime stuff is under /usr/local/share/kak

Sourcing /usr/local/share/kak/kakrc gives an error: “def : command ‘colorscheme’ already defined”

I don’t know how to debug this. Can anyone provide some tips? I am running the latest “master” branch.

Do you have a ~/.config/kak/autoload directory? If you do, does in contain a symlink to /usr/local/share/kak/rc?

2 Likes

This was the solution, thank you. I had an empty directory at ~/.config/kak/autoload

For future readers, there is a section on this in the FILES section of man kak

A version of this problem popped up on IRC today. I pointed that person to this post, and symlinking autoload helped.

They mentioned there was no output of warning in the debug buffer. Perhaps Kakoune could detect a misconfiguration here?

Part of the problem is that it’s not a mis-configuration, it’s an intended and legal configuration, although not one that most users would want.

The code that reads files from the autoload directory is in the system-wide kakrc file, and there’s apparently a few ways to test whether a directory is empty in shell. It might be handy to log a warning to the debug buffer (echo -debug Warning: autoload directory $1 is empty), which would hopefully help new users figure out what’s going on, without annoying anyone who sets their system up this way deliberately (although that’s never guaranteed).

I encourage you to try it, and if you can get it working, make a PR.

1 Like