173

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?

1

1 Answer 1

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". enter image description here

9
  • 9
    Could 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, 2012 at 16:48
  • 6
    @fredley ok, The answer has updated !
    – Hamed
    Apr 17, 2012 at 18:16
  • 16
    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. todd.ropog.com/2012/get-notepad-to-recognize-any-file-extension
    – Straff
    Nov 15, 2013 at 22:52
  • 17
    "Restarting" Notepad++ doesn't work. You need to close and reopen the file, actually. Apr 15, 2014 at 0:51
  • 2
    On XML I add csproj so Visual Studio solutions get highlighting Sep 30, 2020 at 18:15

Not the answer you're looking for? Browse other questions tagged .