8

I'm running Standard Debian Wheezy with KDE 4.8.4 and Kate 3.8.4.

The Kate text editor's syntax highlighting files are located in:

/usr/share/kde4/apps/katepart/syntax

If I run

kde4-config --prefix

this gives

/usr

and $KDEDIR is empty. This results in that only XML files in the upper direcory are used for highlighting.

In several other forums, I saw that it should work to create a folder "syntax" in

~/.kde/share/apps/katepart/

If I put syntax-highlighting files there on my system, they appear to be ignored.

How can someone change/set the directory for the syntax-highlighting files used by Kate to an arbitrary directory?

Chrispie
  • 3,613
  • 2
  • 13
  • 16

3 Answers3

9

I found a solution just by chance:

Settings -> Kate config -> Open/Save -> File types

If I click on "Download syntax-highlighting files", all files which are already installed and can be updated (a newer version is available) are marked here. Then a click on "Install" updates alle these files. After that the folder

~/.kde/share/apps/katepart/syntax

exists and includes all installed XML files. Now I can add additional files to that folder or can modify the existing files therein. The modifications will be applied after restarting Kate.

This solves my problem for the moment. But I don't understand why it works in this way! (Maybe someone can comment on that)

The other open task is how one can choose a different folder for the XML files.

Chrispie
  • 3,613
  • 2
  • 13
  • 16
3

For the latest version of Kate, placing syntax xml files in this directory works:

~/.local/share/katepart5/syntax

Thanks @Datalore

Alexander
  • 9,607
  • 3
  • 40
  • 59
0

This doesn't change the directory, but it worked anyway for me. Manually create this directory and place the highlight XMLs there:

$HOME/.local/share/org.kde.syntax-highlighting/syntax/

And don't forget to restart Kate afterwards!

Source: https://docs.kde.org/stable5/en/kate/katepart/highlight.html

Iizuki
  • 101
  • 2