User-defined language not applying to specified file types in Notepad++

不打扰是莪最后的温柔 提交于 2019-12-03 17:33:36

问题


I have created a fairly simple user-defined language in Notepad++, and given it an associated extension. But, when I open files I have named with that extension, nothing happens. No syntax highlighting, or comment highlighting.

Any idea what I have done wrong?

The settings for the extension do not have a leading ".", as specified in the Notepad++ docs.


回答1:


This has been fixed, so I guess the whole question could be closed or deleted. I'm not sure in which version they fixed it, but in the latest v6.5.1 everything works as intended.

  1. Go to menu Language > Define your language...
  2. Create a new language or select from the dropdown menu an existing one
  3. In the Ext. text box add your desired extension with no leading "." and space separated if you have multiple extensions.
  4. Now open a file with such extension and it is properly highlighted. To confirm that the User Defined Language extension is correct, you can also take a look at the userDefineLang.xml usually stored in your %APPDATA%\Notepad++\ folder.



回答2:


Here is a clear guide for how to create your own Notepad++ syntax definition for a new language.

  • http://weblogs.asp.net/jgalloway/archive/2006/11/25/creating-a-user-defined-language-in-notepad.aspx


来源:https://stackoverflow.com/questions/6057578/user-defined-language-not-applying-to-specified-file-types-in-notepad

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