A quick search to try to figure out how to set the syntax highlighting for custom and obscure file types in netbeans 6.9 turned up nothing. Most things I found told me to go to Tools > Options > Advanced Settings and then set it up in there. Well, in my version of netbeans there is no “Advanced Settings,” so I had to figure it out on my own, and this is how I set syntax highlighting for custom file types:
- Go to Tools > Options and an Options panel should pop up.
- Click on Miscellaneous
- Click on the files tab
- Here you will see a list of extensions and their associated file type.
- Click on the “New” Button
- Enter the name of your new extension
- Choose the correct File Type
- All Done!
What this means is that you can now teach netbeans to display .inc files as .php files. You can highlight plain text as html, you can highlight objective-j files as either javascript or c++, or view any other file as any other type. The possibilities are endless.
Granted, this process is pretty obvious once you figure out exactly where in Netbeans’ giant menu you need to look to accomplish this task. Hope this saved some of you some time. Cheers!

#1 by pianodavid on November 17th, 2010
Quote
This is nice, but you don’t happen to know if it is possible to have syntax highlighting on files with no file extension at all? I am involved in maintaining an old system with “kind of” HTML, but all files have no extension and the naming of the files is important for the system, so I can not change the file names.
#2 by Andy on November 17th, 2010
Quote
I tried to get that to work but I had no luck… it might be worth posting in a netbeans forum to see if some experts have a solution. Post back here if you find one. Good luck,
-andy
#3 by Stefan on March 5th, 2011
Quote
Thanks for great tip. I’ve been thinking that I’ve lost my mind, because in 6.9.1 there are no ADVANCED OPTIONS button, and yet, only place tune up options is this dialog.
Thanks again.
#4 by Andy on March 5th, 2011
Quote
Very welcome. I’m glad to see it helped at least one person.
#5 by George on April 8th, 2011
Quote
Thanks a lot! So good that you have included the screenshot. It delivered instant solution
#6 by Andy on April 8th, 2011
Quote
Good to see it helped. Thanks for the comment
#7 by kubilay e. on March 10th, 2013
Quote
great tip, thanks! when developing custom modules with unknown extensions (for example .module in drupal), netbeans goes ignorant. that’s how to tell.