tft每日頭條

 > 生活

 > notepad+怎麼讓代碼有顔色

notepad+怎麼讓代碼有顔色

生活 更新时间:2024-06-26 08:02:19

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

,

更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!

查看全部

相关生活资讯推荐

热门生活资讯推荐

网友关注

Copyright 2023-2024 - www.tftnews.com All Rights Reserved