# I've lost my syntax highlighting

**URL:** <https://discuss.kakoune.com/t/ive-lost-my-syntax-highlighting/2036>\
**Category:** Help\
**Created:** [April 8, 2022, 12:26am UTC](https://discuss.kakoune.com/t/ive-lost-my-syntax-highlighting/2036 "2022-04-08T00:26:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![distrohop](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/distrohop/32/1075_2.png) [@distrohop](https://discuss.kakoune.com/u/distrohop)\
**Post date:** [April 8, 2022, 12:26am UTC](https://discuss.kakoune.com/t/ive-lost-my-syntax-highlighting/2036/1 "2022-04-08T00:26:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Screwtapello](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/screwtapello/32/12_2.png) [@Screwtapello](https://discuss.kakoune.com/u/Screwtapello)\
**Post date:** [April 8, 2022, 1:44am UTC](https://discuss.kakoune.com/t/ive-lost-my-syntax-highlighting/2036/2 "2022-04-08T01:44:56Z")

</div>

Do you have a `~/.config/kak/autoload` directory? If you do, does in contain [a symlink to `/usr/local/share/kak/rc`](https://github.com/mawww/kakoune/wiki/Installing-Plugins)?

---

<div class="post-metadata">

**Author:** ![distrohop](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/distrohop/32/1075_2.png) [@distrohop](https://discuss.kakoune.com/u/distrohop)\
**Post date:** [April 9, 2022, 1:25pm UTC](https://discuss.kakoune.com/t/ive-lost-my-syntax-highlighting/2036/3 "2022-04-09T13:25:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![distrohop](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/distrohop/32/1075_2.png) [@distrohop](https://discuss.kakoune.com/u/distrohop)\
**Post date:** [April 10, 2022, 3:12pm UTC](https://discuss.kakoune.com/t/ive-lost-my-syntax-highlighting/2036/4 "2022-04-10T15:12:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![distrohop](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/distrohop/32/1075_2.png) [@distrohop](https://discuss.kakoune.com/u/distrohop)\
**Post date:** [September 18, 2023, 6:02pm UTC](https://discuss.kakoune.com/t/ive-lost-my-syntax-highlighting/2036/5 "2023-09-18T18:02:13Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Screwtapello](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/screwtapello/32/12_2.png) [@Screwtapello](https://discuss.kakoune.com/u/Screwtapello)\
**Post date:** [September 19, 2023, 7:47am UTC](https://discuss.kakoune.com/t/ive-lost-my-syntax-highlighting/2036/6 "2023-09-19T07:47:19Z")

</div>

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](https://github.com/mawww/kakoune/blob/01fd6552af6b909f533d5cd8bf3a5385d4e35215/share/kak/kakrc#L30-L33), and there’s [apparently a few ways](https://unix.stackexchange.com/questions/202243/how-to-check-directory-is-empty) 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](https://xkcd.com/1172/)).

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