Menu

.config file -> XML language

2008-01-09
2012-11-13
  • Nobody/Anonymous

    I'd like Notepad++ automatically to open files with .config extension as XML files. Now it opens them as normal text and when I choose the language manually it's OK, but I have to do this every time I open XML configuration file. Is there an option to tell Notepad++ that .config files are actually XML files?
    Thanks in advance!

     
    • Nobody/Anonymous

      Yes, there is. Look for the dialog which allows adding extensions, linking them to languages.

       
      • Nobody/Anonymous

        There is a dialog (Preferences -> File Association) that allows choosing which files to be associated with Notepad++. But I can't find there a way to link extensions to language ): Should I look somewhere else?

         
      • Nobody/Anonymous

        OK, I found a way to do that, but I'm not sure is the the only one.
        The languages and associated file exts are defined in the file langs.xml in Notepad++ folder. I found that line:
        <Language name="xml" ext="xml xsml xsl kml" commentLine="" commentStart="&lt;!--" commentEnd="--&gt;">
        and added config after xml xsml xsl kml. Now it works fine :)

         
    • Mark Baines

      Mark Baines - 2008-01-09

      You can also do this in the Styler Configurator. Look for XML in the left pane and and when selected a "User ext:" field appears. Type config in there. Leave a space between extensions and don't include the full stop. I also have rdf, dtd and xul in there.

      Mark B

       
      • Nobody/Anonymous

        Thanks Mark, that way is much better for me ;)

         
    • Nobody/Anonymous

      What happens if there is no extention as in xmltextfilledfile.     where there is nothing after the last dot?