notepad+怎么让代码有颜色(使用scala语言高亮显示或语法作色)

Notepad 缺省不支持Scala语言高亮显示或语法着色,下面是一个实现语法着色的方法:

1、将面的内容复制到userLangDefine.xml文件中

  1. <NotepadPlus>
  2. <UserLang name="Scala" ext="scala">
  3. <Settings>
  4. <Global caseIgnored="no" />
  5. <TreatAsSymbol comment="no" commentLine="yes" />
  6. <Prefix words1="no" words2="no" words3="no" words4="no" />
  7. </Settings>
  8. <KeywordLists>
  9. <Keywords name="Delimiters">"'0"'0</Keywords>
  10. <Keywords name="Folder ">{</Keywords>
  11. <Keywords name="Folder-">}</Keywords>
  12. <Keywords name="Operators">- ! " # % & @ | ~ < = ></Keywords>
  13. <Keywords name="Comment">1/* 1/** 2*/ 2*/ 0//</Keywords>
  14. <Keywords name="Words1">class def extends forSome import object package trait type val var with</Keywords>
  15. <Keywords name="Words2">boolean byte char double float int long short false new null super this true</Keywords>
  16. <Keywords name="Words3">case catch do else finally for if match requires return throw try while yield</Keywords>
  17. <Keywords name="Words4">abstract final implicit lazy override private protected sealed</Keywords>
  18. </KeywordLists>
  19. <Styles>
  20. <WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
  21. <WordsStyle name="FOLDEROPEN" styleID="12" fgColor="004080" bgColor="FFFFFF" fontName="" fontStyle="1" />
  22. <WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="004080" bgColor="FFFFFF" fontName="" fontStyle="1" />
  23. <WordsStyle name="KEYWORD1" styleID="5" fgColor="004080" bgColor="FFFFFF" fontName="" fontStyle="1" />
  24. <WordsStyle name="KEYWORD2" styleID="6" fgColor="004080" bgColor="FFFFFF" fontName="" fontStyle="1" />
  25. <WordsStyle name="KEYWORD3" styleID="7" fgColor="004080" bgColor="FFFFFF" fontName="" fontStyle="1" />
  26. <WordsStyle name="KEYWORD4" styleID="8" fgColor="004080" bgColor="FFFFFF" fontName="" fontStyle="1" />
  27. <WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="2" />
  28. <WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="2" />
  29. <WordsStyle name="NUMBER" styleID="4" fgColor="800000" bgColor="FFFFFF" fontName="" fontStyle="0" />
  30. <WordsStyle name="DELIMINER1" styleID="14" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="0" />
  31. <WordsStyle name="DELIMINER2" styleID="15" fgColor="800080" bgColor="FFFFFF" fontName="" fontStyle="0" />
  32. <WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
  33. </Styles>
  34. </UserLang>
  35. </NotepadPlus>

2、在Notepad 中,点菜单:语言->自定义语言格式->导入,选择第1步中创建的文件,导入。

3、关闭Notepad ,然后重新打开,在菜单:语言->自定义语言格式下出现一个“scala”的新菜单项,设置成功。

notepad+怎么让代码有颜色(使用scala语言高亮显示或语法作色)(1)

,

免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com

    分享
    投诉
    首页