attachments/tgonzalez/media/windowslivewriter/devtipsconfiguringfiletyperecognitioninn_dfbb/image1_thumb_1.png

DevTips: Configuring File Type Recognition in Notepad++ (to Trigger Syntax Highlighting)

When you need to dig into a code file without spinning up it’s respective IDE and still benefit from syntax highlighting Notepad++ is a great alternative to the native Notepad application that comes baked into Windows.  Out-of-the-box Notepad++ supports over 50 programming, scripting, and markup languages.  Every once in while you’ll open a code file but Notepad++ fails to auto recognize the content and apply the appropriate languages syntax highlighting schema.  That’s because it’s matching on the files extension, not the content.

 

Image1

 

 

There are 2 ways to fix this…

Solution 1

Manually switch to the desired language:

Image2  

 

 

Solution 2 (much better)

Doing this manually can get old really fast so if you’re really lazy like me you can configure the file extension (e.g. – .config, .transform) to be associated with a specific language like so:

Settings > Style Configurator…

Image3  

 

Choose the language and enter 1 or more file extensions separated by spaces.  Then click ‘Save & Close’.

Image4  

 

 

Now that we’re all setup the next time you open any file with that extension it will automatically apply syntax highlighting with the chosen language.

Image5 

Leave a Reply