Make Geany recognize additional file extensions

9k views Asked by At

My default Geany installation on Debian does not recognize some file types out of the box. How can I add extensions, using the same syntax highlighting as other known extensions for simplicity's sake?

In the current case, I'd like Geany to open all .aspx files with the same highlighting as .html files.

3

There are 3 answers

1
frlan On BEST ANSWER

Use inside the menu Tools->Configuration files->filetype_extensions.conf. This will allow you to configure the filetypes based on suffix for your user.

1
Lonnie Best On

I had trouble accomplishing this without help from here.

Go here to read documentation about this topic.

From the Geany menu, go to:

Tools > Configuration Files > filetype_extensions.conf

Go to this line and un-comment it:

#~ [Extensions]

So that it just reads:

[Extensions]

I was needing to add .mjs as an additional extension for javascript. So, for me, I also uncommented this line:

#~  Javascript=*.js;

And changed it to:

Javascript=*.js;*.mjs;

After this, I saved the file.

Now when I opened files having a .mjs file extension, they automatically have Javascript Syntax Highlighting.

I made some suggestions to improve this expeirience here.

3
Mislav Blažević On

Just add new extensions in /usr/local/share/geany/filetype_extensions.conf