Online all the examples for Geany have syntax coloring, but I couldn't figure out how to enable this feature. I downloaded Geany, then created a new python file, but whenever as I type a keyword, number, string, ... the color stays black even after saving. Do I have to install an additional plug-in or is there an option somewhere to enable coloring?
The "coloring" is called syntax highlighting and it is based on the detected file type. The file type detecting pretty much works on two paths:
- from file extension. So a file with extension .py is recognized as Python file. This can be configured via Tools->Configuration Files->filetypes_extensions.conf
- from manual choice from inside Document menu. So e.g. "Document->Set Filetype->Scripting Languages->Python source file" for setting Python
In some cases the so called shebang -- the #!/bin/... at the start of a file -- is also used to determine the file type.
In your case, you should ensure you have saved your file with a extension marked as Python and/or choose manually.
There is a great collection of syntax highlight themes on Github. Please check:
Just follow the
Unix-like Installation section:
Extract the tarball and copy all of the files in the colorschemes directory to your ~/.config/geany/colorschemes/ directory. Create that directory if it doesn't already exist.
Besides connecting the file extension to a file type (like mentioned in frian's answer), there is a general setting that was overseen by me. Make sure that in
- View --> Color Schemes...
there's not an entry selected that says "null" as the bracketed value. Im my case, this was: "github.conf (null)". You can either pick one of "Standard" or "Alternate" or even add further color schemes as described in Michal's answer.