Notepad++: How to automatically set Language as Xml when load files

与世无争的帅哥 提交于 2019-12-02 14:19:59

You can do this by using the Style Configurator (Settings Menu):

This image shows the php language, but it works for any language you want to map

From the Settings menu, choose Style Configurator.... Choose the XML Language from the list, and enter "config" in the User ext field.

I don't think you can set a default style for all files (there may be some config file trickery that does allow it though) but as you specifically mention .config files, you can open the langs.xml or langs.model.xml file in your Notepad++ installation directory, find the xml section, and add config to the value of the ext attribute:

<Language name="xml" ext="xml xsml xsl xsd kml wsdl config" commentLine="" commentStart="&lt;!--" commentEnd="--&gt;">
</Language>

Or, use the Style Configuarator as noted by @AdamHawkes (+1), instead of messing around in the XML config files themselves!

To set a 'global' default language:

  1. Launch Notepad++
  2. Click Settings > Preferences
  3. Click on the New Document/Default Directory tab
  4. Change the Default Language to HTML
  5. Click the Close button

For anyone that's seeing this in 2017, the location has changed:

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!