2

Is there a way to add syntax highlighting for the Groovy language in kate?

Or is there a quite similar language, that will work as well?

rubo77
  • 19,527
  • 31
  • 134
  • 226

1 Answers1

5

Yes, you can put this xml file under /usr/share/apps/katepart/syntax/ if you want it to be installed at system's level, otherwise in ~/.kde4/share/apps/katepart/syntax/ if you want it at user's level:

mkdir -p ~/.kde/share/apps/katepart/syntax
cd ~/.kde/share/apps/katepart/syntax
wget http://docs.codehaus.org/download/attachments/2747/groovy.xml

This works for KDE4. For other versions you might follow this blog post.

jopasserat
  • 5,721
  • 4
  • 31
  • 50
PhilMr
  • 475
  • 1
  • 5
  • 13
  • 1
    http://codelearnings.blogspot.co.uk/2014/08/syntax-highlighting-for-groovy-in-kate.html : To make Groovy syntax highlighting work, I instead had to place the groovy.xml file into ~/.kde/share/apps/katepart/syntax/ in order to make it available for a single user or in /usr/share/kde4/apps/katepart/syntax to make it available system wide. Restart Kate, here you go. It gets picked up automatically when you save a .groovy file and resides in the Tools -> Highlighting -> Sources menu. – V H Apr 27 '15 at 13:22
  • It kind of works, when saving a file, but I cannot find it inside the "Tools -> Highlighting -> Sources menu" – rubo77 Apr 27 '15 at 13:47
  • Hey Rubo - ye I found its tricky if you open a groovy and it don't highlight it - do save after which it does... so requires 1 save action per time it does not highlight – V H Apr 27 '15 at 14:20
  • @vahid: yes, so it seems the integration is not completely correct, but it helps already a lot (you can delete your first comment) – rubo77 Apr 27 '15 at 14:27
  • I added your comment to the answer, SDI you can remove all non-essential comments here – rubo77 Apr 28 '15 at 10:29
  • Since the link above is dead, try this one instead: https://bugsfiles.kde.org/attachment.cgi?id=84306 (someone suggested KDE incorporated it into Kate, but the case seems stuck) – hauron Jul 08 '15 at 07:34