Currently opening .sql files in Notepad++ results in Notepad applying SQL syntax highlighting to it. I'd like Notepad++ to do the same for other extensions as well, is there some setting where I can define this ?

link|improve this question

It doesn't already? It should do so by default. – D'Arvit Sep 14 '09 at 10:11
It does for .sql files, not for other files – Sathya Sep 14 '09 at 10:12
feedback

3 Answers

up vote 46 down vote accepted

When you open a file in notepad++ it will attempt to load syntax highlighting for the contents based on file extension.

If you use custom extension for one of the existing languages you can add the custom extension in Settings -> Styler Configurator. Select language and add the extension in "User extension" edit box. To add multiple extensions separate them using space.

You can also change syntax highlighting style by selecting a different language from language menu.

link|improve this answer
I have tried this, but it assigns only to 1 extension, I want to assign multiple extensions. – Sathya Sep 14 '09 at 11:39
4  
you can add multiple extensions by separating them with space, added that into my post – T. Kaltnekar Sep 14 '09 at 12:23
Thank you, it works fine! – Sathya Sep 14 '09 at 13:58
Thanks! Would have never figured it out on my own:) – axk Nov 25 '11 at 11:21
Note that making this change will not effect files that are currently open in Notepad++. Also, closing and re-opening Notepad++ still will not effect files that remain open between sessions. The individual files must be closed and re-opened for the effect to be seen. – mwolfe02 May 10 at 16:12
feedback

Find the langs.xml file, open it with Notepad++, find the line that begins with <Language name="sql" ext="sql" and add the extensions you want in the ext field, separating them with a space.

link|improve this answer
+1 you got there first – harrymc Sep 14 '09 at 10:30
1  
This approach works fine as well, but T. Kaltnekar's approach is a bit more user friendly, thanks! – Sathya Sep 14 '09 at 13:59
It's the only way I knew how :). – alex Sep 14 '09 at 14:01
Taught me another trick :) – Sathya Sep 14 '09 at 14:43
1  
In fact, this is the answer. – Tim Nov 8 '11 at 14:36
show 1 more comment
feedback

Settings > style configurator > select the language you want it to look like > add your extension in the user ext field

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.