Search code examples
geany

How to change comment syntax in Geany


In Geany, editing PHP scripts, when you select lines and press control-e, the selected lines are commented by being wrapped in "/* ... */". Is there a way to change this behaviour so that it instead puts a "//" in front of each line?

All the other IDEs that I've used make use of "//" (Eclipse, Netbeans, Textmate, etc).


Solution

  • Settings like comment characters are controlled by filetype definition files. Assuming your scripts end in .php, you should find the default system-wide filetype definition file filetypes.php, and copy it to your filedefs directory in your user configuration directory. Then you can modify it as necessary.

    This is all explained in detail in the manual (link above).