I have associated .wxs files with Notepad++. So far so good. However, it doesn't remember that it should use XML syntax highlighting. How do I associate a file-type with a Language?
Asked
Active
Viewed 1.2e+01k times
173
fredley
- 3,417
- 10
- 32
- 43
-
1similar question: http://superuser.com/questions/40876/assigning-custom-extensions-to-a-languages-syntax-highlighting-in-notepad – Valentino Vranken Sep 14 '12 at 08:08
1 Answers
278
As here is mentioned : ASSOCIATE FILE EXTENSIONS WITH SPECIFIC LANGUAGES IN NOTEPAD++ you should do :
In Notepad++ navigate to Settings > Style Configurator…
Choose a language on the left side that you want your own extension to match (i.e. if I want .config files to style like XML then I’d choose XML). In the User ext. field near the bottom, enter in your custom user extension without the dot in front of it (e.g. config for *.config files). Now restart Notepad++ and it will map that new extension to the style you’ve chosen.
NOTE: Make sure you are running Notepad++ using Administrator privileges, otherwise the settings won't be saved when you click "Save and Close".
-
9Could you summarise the contents of the link in your answer, so that we don't lose it if that link goes dead for some reason? – fredley Apr 17 '12 at 16:48
-
6
-
-
16Also, 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. http://todd.ropog.com/2012/get-notepad-to-recognize-any-file-extension/ – Straff Nov 15 '13 at 22:52
-
17"Restarting" Notepad++ doesn't work. You need to close and reopen the file, actually. – Wolfpack'08 Apr 15 '14 at 00:51
-
-
As of v7.4.2 (Jun 18, 2017) I can confirm just restarting worked for me. – Martin S. Stoller Dec 13 '17 at 18:38
-
This seems to not work if there are conflicts....for example, I want xml files to open as java, doing the above does not work. – tbone Nov 15 '19 at 18:59
-
2On `XML` I add `csproj` so Visual Studio solutions get highlighting – Chris Marisic Sep 30 '20 at 18:15
