7

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?

  • I'm using Debian Wheezy, KDE 4.8.4, Kate 3.8.4 and the current directory is: /usr/share/kde4/apps/katepart/syntax – Dr Beco Sep 27 '14 at 3:18
  • You're right. This was only typo. I corrected this in my question, thanks. – Chrispie Oct 6 '14 at 13:32
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.

  • 5
    As of katepart5, the standard directory is now ~/.local/share/katepart5/syntax – Datalore Feb 2 '15 at 0:37
  • The directory is now ~/.local/share/org.kde.syntax-highlighting/syntax – Adrian Willenbücher Dec 3 '18 at 7:52
2

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

~/.local/share/katepart5/syntax

Thanks @Datalore

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.