9

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?

3
  • I'm using Debian Wheezy, KDE 4.8.4, Kate 3.8.4 and the current directory is: /usr/share/kde4/apps/katepart/syntax Commented Sep 27, 2014 at 3:18
  • You're right. This was only typo. I corrected this in my question, thanks. Commented Oct 6, 2014 at 13:32
  • reddit.com/r/kde/comments/67o0sd/… Commented Oct 21, 2017 at 10:19

3 Answers 3

10

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.

2
  • 5
    As of katepart5, the standard directory is now ~/.local/share/katepart5/syntax Commented Feb 2, 2015 at 0:37
  • 1
    The directory is now ~/.local/share/org.kde.syntax-highlighting/syntax Commented Dec 3, 2018 at 7:52
3

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

~/.local/share/katepart5/syntax

Thanks @Datalore

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

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.