Pages

Friday, August 8, 2014

Syntax Highlighting for Groovy in Kate

Groovy has been my scripting language of choice for some time now and since I'm running KDE I'm using Kate for quick scripts. And even though Groovy has been around for quite some time and Kate supports a myriad of syntax highlighting modes, Groovy for some odd reason isn't one that comes bundled with Kate out of the box. At least not up to my current KDE version 4.13.2 running on Ubuntu derivatives - neither on (K)Ubuntu nor my latest install of Mint 17 KDE.

Thankfully Kate's syntax highlighting is extendible and the Groovy project provides plugins for various editors including kate. Unfortunately the instructions on  this page have never worked for me on an Ubuntu based system. The path names listed on that plugin page weren't correct with any install of KDE out of the repository.

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.

No comments:

Post a Comment