Syntax highlighting, Gedit
Johnny Rosenberg
gurus.knugum at gmail.com
Sun Feb 17 13:25:24 UTC 2013
Since I want more c ”keywords” to be highlighted in Gedit I edited
/usr/share/gtksourceview-3.0/language-specs/c.lang.
I intend to work with a specific library for a while and I want its
definitions to be highlighted, such as variable types and defined
”macros” (#define SOMETHING).
There are quite a few lines to add, and I noticed that some of the
pre-defined things in the c.lang file use something that look like
some simple variant of regular expressions, such as this line in the
types section:
<keyword>(u)?int(8|16|32|64)_t</keyword>
Seems like it describes the following types in just one line:
int8_t
int16_t
int32_t
int64_t
uint8_t
uint16_t
uint32_t
uint64_t
That's great. Now I wonder if I can do something similar to those
keywords for the library I was talking about. All of them looks like
SF_SOMETHING.
So I would like to do something like:
<keyword>SF_*</keyword>
Of course, this doesn't work, and I didn't expect it to, I just try to
illustrate what I mean, using * as some kind of wildcard…
Is this possible at all, or do I need to define them all one by one?
Which I already did, but the filer would be easier to search in the
less lines it contains.
Also, this is a global file. Can I add my own additions to a local
file instead? If so, where do I have to put it and what name should it
have and what should it look like…? Many questions… :P
Johnny Rosenberg
More information about the ubuntu-users
mailing list