Get Notepad++ to Recognize Any File Extension

Notepad++ is my favorite text editor on the Windows platform; however, I’ve often wished it would recognize other file extensions and use the appropriate language setting. On several occasions I have poked around in the Preferences, but was never able to find a way to get it to do that. (It’s a testament to my laziness that I hadn’t bothered to put much energy into figuring it out, despite the fact that it repeatedly annoyed me.) Well, today I noticed the Style Configurator menu option and wondered what it was. It turns out this is where you get Notepad++ to recognize other extensions!

Simply go to the Settings menu and then click on Style Configurator dialog:

In the Language list, select the language you would like an extension to default to. For example, I typically want *.config files to be opened as XML files. To do this, select the XML language, enter “config” into the User ext. field, and then click Save & Close. That’s it! Now when you use Notepad++ to open a file with a config extension, it will default to the XML language. If you want to associate multiple extensions with the same language, simply enter them all in a space-delimited list.

I’m sure this information is out there somewhere, but I was too lazy to look for it, and I needed to write something on my blog. 😉

Note: this does not create a file associate in the operating system. So if you want to also be able to double-click on a config file and have it automatically open in Notepad++, you’ll also need to create that association in Windows.

 

 

 


2 Responses to “Get Notepad++ to Recognize Any File Extension”

  • Brendan Enrick

    Also, it’s worth noting that if you make this change and have a file open already, Notepad++ will cache the file’s current no-language selection. This means that you will need to specifically close the file in Notepad++ before it will recognize the extension.

  • Jim

    Thanks – that was exactly what I needed!