Syntax highlighting, Gedit
Johnny Rosenberg
gurus.knugum at gmail.com
Sun Feb 17 15:19:45 UTC 2013
2013/2/17 Avi Greenbury <lists at avi.co>:
> Johnny Rosenberg wrote:
>> 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.
>
> It's certainly possible to define your own languages, and I suspect
> you're most of the way there, but for not know what sort of regular
> expressions it expects.
>
> Gedit uses gtksourceview to work out what colours to use for which
> characters, and the documentation on creating a new language
> definition for it is here:
>
> http://developer.gnome.org/gtksourceview/stable/lang-tutorial.html
Thanks! I'll have a look at it later.
>
> I don't suggest you go so far as to create your own subset of the C
> definition, but that should at least tell you which elements need to
> be added and where. I should also, perhaps, warn you that I've never
> done this either, so I can't offer any real help directly.
>
>>
>> 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
>
> I wouldn't have thought there was a way to have your own, personal,
> syntax highlighting definitions, just because it sounds niche enough
> that I wouldn't expect anyone to have implemented it :)
Would have been nice if Gedit could search the code automatically for
user defined types and functions and colour them appropriately. Maybe
those should have a different colour from those system specific ones,
making it easy to see that this function is my own and this is a
pre-defined included in some common library.
I have spent some time now to add definitions from the most common
libraries, such as stdlib, math and a few more. I think it's easier to
add the rest when I need them…
One drawback with all this is that when I added all that stuff, they
will be coloured whether I include those libraries or not.
Johnny Rosenberg
>
> --
> Avi
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
More information about the ubuntu-users
mailing list