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:

This is where you can declare custom file types.

  1. Go to Tools > Options and an Options panel should pop up.
  2. Click on Miscellaneous
  3. Click on the files tab
  4. Here you will see a list of extensions and their associated file type.
  5. Click on the “New” Button
  6. Enter the name of your new extension
  7. Choose the correct File Type
  8. 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!