Syntax Highlighting in Notepad++: How to treat a user-defined language as built-in?

删除回忆录丶 提交于 2019-12-03 03:00:26
psxls

It should be working. Check again:

  1. Go to Settings → Style Configurator, select your language and add in the User ext. the ahk extension (without a dot!).
  2. If it's a User Defined Language, then go to Language → Define your language, then select from the dropdown list your language, and in the text box named Ext. that will appear, add your "ahk" extension.
  3. Make sure that the ahk extension is defined ONLY to AutoHotKey, not in two languages simultaneously (so remove the extension from AutoIt).
  4. If it's still not working, check your Notepad++ version. Latest is 6.5.1, previous versions might had a bug.

To install the syntax highlighter in Notepad++ version 6+:

  1. In the main menu, go to View > User defined language...
  2. Push the "Import..." button.
  3. Browse to the syntax colouring file. It may be either an .xml or a .udl file.
  4. It will report "Import Successful"
  5. Now, go and open one of the configuration files in Notepad++.
  6. Voila! Colour!

If the file was created correctly, it should already include the extension reference and automatically recognize new files and display them in the proper context. However, any files open in NPP will not automatically display the new colour highlighting until you close and re-open them.

Here is more information on NPP highlighters.

Here are some more User-Defined Highlighters.

Otherwise, maybe something is wrong with your udl file. You can try one that I made, if you like.

My problem was that upon importing a friend's file, the extension field associated with my user-defined language had quotes around it : "mcr". I eliminated the quotes and now it works perfectly.

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