Enable syntax coloring in Geany?
Solution 1
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.
Solution 2
There is a great collection of syntax highlight themes on Github. Please check:
https://github.com/codebrainz/geany-themes
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.
Related videos on Youtube
user2154420
Updated on September 18, 2022Comments
-
user2154420 over 1 year
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?
-
Timo over 6 years@Ravan, did not work if you highlight one variable and would like to see all variables with the same name highlighted.
-
Timo over 6 yearsI found on the geany plugins docu website a third party login which treats the
highlightword
problem. There is a difference between syntaxcoloring
andhighlighting
, my fault.
-
-
Timo over 6 yearsIs this really related to syntax highlight or to color themes in general appearance (dark, light, etc.)?
-
Michal Przybylowicz over 6 years@Timo Title on the github is misleading - it's related to syntax highlighting.
-
Timo over 6 yearsThanks, I found on the geany plugins docu website a third party login which treats the
highlightword
problem.