Adding New FIle Extension to An Existing Syntax Highlighting in Geany

Sunday, August 21, 2011 10 Comments

Adding New FIle Extension to An Existing Syntax Highlighting in Geany? That was my question before. I used to use Notepad++ while on Windows as my fav Text Editor. But, in Ubuntu, I am using Geany. It's been long time but, I still couldn't add new file extension to using existing syntax highlighter in Geany. I thought : this is suck enough to get my script highlighted by (manually) clicking Document > Set Filetype > Scripting Language > PHP Source File. Eeeevery time I open 'undefined' extensions >.<

While in Notepad++, I just have to Preferences. Not in Geany. I have gone to Preferencces menu and swept the menu. But nothing. Googling is just confusing. Might be because Geany users are not 'active'. The help menu is just the same confusing -___-"

OK then. I got the way anyway :D Here it is :
  1. You just need to click the Tools menu > Configuration file >  choose filetypeextentions.conf
  2. Find highlighting name and add your extension. 
  3. For example : I need to add *.ctp and *.thtml extensions to use PHP highlight.
    So, I go to line named PHP. And add the extensions separated by semicolon (;). The result is
    PHP=*.php;*.php3;*.php4;*.php5;*.phtml;*.ctp;*.thtml;
  4. Save, and you've done :D

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Do you think I forgot to change this text? No, dude. I did it on purpose ahahahay..

10 comments

Write comments
Anonymous
AUTHOR
May 23, 2012 at 4:43 AM delete

Exactly what I needed! Thanks

Reply
avatar
Unknown
AUTHOR
August 31, 2012 at 4:58 AM delete

Thank you so much! CakePHP on Geany here I go!

Reply
avatar
Anonymous
AUTHOR
March 7, 2013 at 2:47 AM delete

Great, thank you.

Reply
avatar
Unknown
AUTHOR
March 8, 2013 at 4:39 PM delete

Consider to use Sublime Text. It rocks!

Reply
avatar
March 26, 2013 at 9:07 AM delete

Another user satisfied. Thanks for the tip!

Reply
avatar
Anonymous
AUTHOR
April 9, 2013 at 4:18 PM delete

Ok, but how can I add a new syntax highlight to geany... for example - some kind of XML-mod syntax.

Reply
avatar
Unknown
AUTHOR
June 8, 2013 at 4:40 PM delete

thanks mate you saved my time

Reply
avatar
Anonymous
AUTHOR
March 6, 2014 at 12:44 PM delete

Thank you so much.
Very helpful contents.

Reply
avatar