[Geany-Users] Help: Custom syntax highlighting file.

Lex Trotman elextr at xxxxx
Tue Sep 3 10:14:14 UTC 2013


Hi,

Couple of comments below.

Cheers
Lex


On 3 September 2013 19:59, Daniel Carrera <dcarrera at gmail.com> wrote:

> Hello,
>
> I want to add syntax highlighting for Gnuplot files. I have made an
> effort to follow the documentation but the syntax highlighting doesn't
> work. My guess is that I got the file contents wrong. I am using the
> instructions in the manual:
>
> http://www.geany.org/manual/dev/index.html#custom-filetypes
>
> As instructed, I edited  filetype_extensions.conf  and inserted the
> following line:
>
> Gnuplot=*.plt;*.gp;
>
> I also created filetypes.Gnuplot.conf and I have every indication that
> Geany can in fact read this file:
>
> 1) I now have a new menu entry: Document > Set Filetype > Gnuplot file.
> 2) Geany seems to recognize that a file with the .plt or .gp extension
> is a Gnuplot file (it says "Gnuplot" on the status bar).
> 3) All this stops working if I remove filetypes.Gnuplot.conf
>
> So clearly Geany can see the file. But I do not have any kind of
> syntax highlighting that I can see. So I suppose that my file contents
> are wrong. Here is the file. Can anyone see an obvious problem with
> it?
>
> -------------------------- // --------------------------
> # For complete documentation of this file, please see Geany's main
> documentation
> [styling]
>

It is better to use named styles rather than setting hard colours, then
your filetype will also adapt with loaded colour schemes.



> # foreground;background;bold;italic
> default=0x000000;0xffffff;false;false
> commentline=0xd00000;0xffffff;false;false
> number=0x007f00;0xffffff;false;false
> word=0x111199;0xffffff;true;false
> string=0xff901e;0xffffff;false;false
> character=0x404000;0xffffff;false;false
> operator=0x301010;0xffffff;false;false
> identifier=0x000000;0xffffff;false;false
> backticks=0x000000;0xd0d0d0;false;false
> param=0x009f00;0xffffff;false;false
> scalar=0x105090;0xffffff;false;false
> error=0xff0000;0xffffff;false;false
> here_delim=0x000000;0xddd0dd;false;false
> here_q=0x7f007f;0xddd0dd;false;false
>
>
> [keywords]
> primary=at help plot set terminal eps png svg enhanced plot key top
> down left right label xlabel ylabel xrange yrange
>
>
> [settings]
>

To get highlighting you need to specify a lexer using the lexer_filetypes
setting, see http://www.geany.org/manual/current/index.html#settings-section

Since there isn't a GNUPlot lexer you need to specify something "close
enough".




> # default extension used when saving files
> extension=plt
>
> # the following characters are these which a "word" can contains, see
> documentation
> #wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
>
> # single comments, like # in this file
> comment_single=#
> # multiline comments
> #comment_open=
> #comment_close=
>
> # set to false if a comment character/string should start a column 0
> of a line, true uses any
> # indentation of the line, e.g. setting to true causes the following
> on pressing CTRL+d
>         #command_example();
> # setting to false would generate this
> #       command_example();
> # This setting works only for single line comments
> comment_use_indent=true
>
> # context action command (please see Geany's main documentation for
> details)
> context_action_cmd=
>
> [indentation]
> #width=4
> # 0 is spaces, 1 is tabs, 2 is tab & spaces
> #type=1
>
> [build_settings]
> # %f will be replaced by the complete filename
> # %e will be replaced by the filename without extension
> # (use only one of it at one time)
> run_cmd="./%f"
> -------------------------- // --------------------------
>
> Thanks for the help.
>
> Cheers,
> Daniel.
> _______________________________________________
> Users mailing list
> Users at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/users/attachments/20130903/78c0b097/attachment.html>


More information about the Users mailing list