[Geany-Users] Help: Custom syntax highlighting file.
mbrush at xxxxx
Tue Sep 3 13:04:27 UTC 2013
On 13-09-03 04:30 AM, Daniel Carrera wrote:
> Hi Lex,
>> It is better to use named styles rather than setting hard colours, then your
>> filetype will also adapt with loaded colour schemes.
> Ok. I found an example of that in filetypes.Python and I copied it.
Depending which lexer you use, the style definitions will be different,
so if you copied Python's [styling] section but then used the Perl
lexer, it probably won't work too good (except maybe for really common
stuff like comments, normal strings, etc). To get an idea where these
names come from you'd have to look inside
`scintilla/include/Scintilla.iface` and `src/highlightingmappings.h`
files in Geany's source tree.
>> 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
> Ok. I tried to do this. I can get several lexers working (Perl,
> Python, C, Tcl) but the Bash lexer doesn't seem to do anything. No
> matter, the Perl and Python lexers seem to work fine.
It depends on a) having a language that's "close enough" to your
language that the given lexer can understand enough to get some useful
highlighting and b) having the right stuff in `[styling]` that
corresponds to your lexer, which is easier to do like
`[styling=AnotherFiletype]` to copy from the true filetype, for example
More information about the Users