Table of Contents
All colour definitions and other filetype specific settings are stored in the filetype definition files. Those settings are colours for syntax highlighting, general settings like comment characters or word delimiter characters as well as compiler and linker settings.
The system-wide configuration files can be found in
$prefix/share/geany
and are called
filetypes.$ext
, where $prefix is the path where
Geany is installed (commonly
/usr/local
) and $ext is the name of the filetype.
For every filetype there is a corresponding definition file. There is one exception:
filetypes.common
- this file is for general settings, which
are not specific to a certain filetype. It is not recommended to edit the
system-wide files, because they will be overridden when Geany is updated.
To change the settings, copy a file from $prefix/share/geany
to the subdirectory filedefs
in your configuration directory
(usually ~/.geany/
).
For example:
%
cp /usr/local/share/geany/filetypes.c /home/username/.geany/filedefs/
Then you can edit the file and the changes are also available after an update of
Geany because they reside in your configuration
directory. Alternatively, you can create a file
~/.geany/filedefs/filetypes.X
and add only these settings you
want to change. All missing settings will be read from the corresponding global
definition file in $prefix/share/geany
.
In this section the colours for syntax highlighting are defined.
The format is always:
key=forground_colour;background_colour;bold;italic
Colours have to be specified as RGB hex values prefixed by 0x. For example red is 0xff0000, blue is 0x0000ff. The values are case-insensitive, but it is a good idea to use small letters. Bold and italic are flags and should only be "true" or "false". If their value is something other than "true" or "false", "false" is assumed.
This section contains keys for different keyword lists specific to the filetype. Some filetypes do not support keywords, so adding a new key will not work. You can only add or remove keywords to/from an existing list.
The keywords list must be in one line without line ending characters.
Table 4.1. General settings
Table 4.2. Build settings
Key | Description | Example |
---|---|---|
compiler |
This item specifies the command to compile source code
files. But it is also possible to use it with
interpreted languages like Perl or Python. With these
filetypes you can use this option as a kind of syntax
parser, which sends output to the compiler message
window.
You should quote the filename to also support filenames with spaces. The following wildcards for filenames are available:
| compiler=gcc -Wall -c "%f" |
linker | This item specifies the command to link the file. If the file is not already compiled, it will be compiled while linking. The -o option is automatically added by Geany. This item works well with GNU gcc, but may be problematic with other compilers (esp. with the linker). | linker=gcc -Wall "%f" |
run_cmd | Use this item to execute your file. It has to have been built already. Use the %e wildcard to have only the name of the executable (i.e. without extension) or use the %f wildcard if you need the complete filename, e.g. for shell scripts. | run_cmd="./%e" |
There is a special filetype definition file called
filetypes.common
. This file defines some general
non-filetype-specific settings.
Table 4.3. General settings
Key | Description | Example |
---|---|---|
default | The default style for text (e.g. for files without filetype). For the detailed format, please see the above "[styling] Section". | default=0x000000;0xffffff;false;false |
selection | The style for colouring selections. Only foreground and background colour are interpreted. | selection=0xc0c0c0;0x00007F;false;false |
brace_good | The style for brace highlighting when a matching brace was found. | brace_good=0xff0000;0xFFFFFF;true;false |
brace_bad | The style for brace highlighting when no matching brace was found. | brace_bad=0x0000ff;0xFFFFFF;true;false |
caret | The style for colouring the caret(the blinking cursor). Only the first argument is interpreted. | caret=0x000000;0x0;false;false |
current_line | The style for colouring the background of the current line. Only the second argument is interpreted. | current_line=0x0;0xE5E5E5;false;false |
folding_style | The style of folding icons. Only first and second
arguments are used.
Valid values for the first argument are:
Valid values for the second argument are:
| folding_style=1;1;false;false |
invert_all | Whether to invert all defined colours. This is useful
if you like a dark background colour(e.g. black) and do
not want to change every single line. Please note, at
time of writing this was only tested with the C syntax
highlighting.
Only first argument is interpreted. Set it to 1 to invert all colours. | invert_all=0;0;false;false |