Configuring Language Recognition in GEdit
In GEdit, there is fairly good built-in support for SQL keyword highlighting and such, but it only recognizes the /* */ form of comments. When creating scripts for Oracle, which can also use a pair of dashes (-- ) at the beginning of a line as a single line comment, GEdit highlights key words in such single line comments, which is slightly distracting.
I've looked under root, and also under Home/.config/gedit, and can't locate any place where the language definitions are located so I can add single line comment recognition to GEdit. Does anyone know how I might go about doing this? I'm using Ubuntu 14.04 by the way. Thanks. |
Gedit uses gtksourceview to define syntax highlighting for several languages. The files are xml and are located in /usr/share/gtksourceview-3.0/language-specs/.
Since you mentioned SQL, the file would be /usr/share/gtksourceview-3.0/language-specs/sql.lang. Copy that file to ~/.local/share/gtksourceview-3.0/language-specs/sql.lang, then edit to get the highlighting you want. You can find a tutorial and a reference document here. |
Wow - I never would have stumbled on that location unaided. Thanks very very much. I was only able to take a quick peek, but I'm sure that's where I'll be able to do what I need.
|
All times are GMT -5. The time now is 07:36 AM. |