Enable syntax coloring in Geany?

5,523

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:

  1. 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
  2. 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.

Share:
5,523

Related videos on Youtube

user2154420
Author by

user2154420

Updated on September 18, 2022

Comments

  • user2154420
    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
      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
      Timo over 6 years
      I found on the geany plugins docu website a third party login which treats the highlightword problem. There is a difference between syntax coloring and highlighting, my fault.
  • Timo
    Timo over 6 years
    Is this really related to syntax highlight or to color themes in general appearance (dark, light, etc.)?
  • Michal Przybylowicz
    Michal Przybylowicz over 6 years
    @Timo Title on the github is misleading - it's related to syntax highlighting.
  • Timo
    Timo over 6 years
    Thanks, I found on the geany plugins docu website a third party login which treats the highlightword problem.