Notepad++使用scala语言高亮显示或语法作色
Notepad++缺省不支持scala语言高亮显示或语法着色,下面是一个实现语法着色的方法:
1、将面的内容复制到userLangDefine.xml文件中
- <NotepadPlus>
- <UserLang name="Scala" ext="scala">
- <Settings>
- <Global caseIgnored="no" />
- <TreatAsSymbol comment="no" commentLine="yes" />
- <Prefix words1="no" words2="no" words3="no" words4="no" />
- </Settings>
- <KeywordLists>
- <Keywords name="Delimiters">"'0"'0</Keywords>
- <Keywords name="Folder+">{</Keywords>
- <Keywords name="Folder-">}</Keywords>
- <Keywords name="Operators">- ! " # % & @ | ~ + < = ></Keywords>
- <Keywords name="Comment">1/* 1/** 2*/ 2*/ 0//</Keywords>
- <Keywords name="Words1">class def extends forSome import object package trait type val var with</Keywords>
- <Keywords name="Words2">boolean byte char double float int long short false new null super this true</Keywords>
- <Keywords name="Words3">case catch do else finally for if match requires return throw try while yield</Keywords>
- <Keywords name="Words4">abstract final implicit lazy override private protected sealed</Keywords>
- </KeywordLists>
- <Styles>
- <WordsStyle name="DEFAULT" styleid="11" fgColor="000000" bgcolor="FFFFFF" fontname="" fontstyle="0" />
- <WordsStyle name="FOLDEROPEN" styleid="12" fgColor="004080" bgcolor="FFFFFF" fontname="" fontstyle="1" />
- <WordsStyle name="FOLDERCLOSE" styleid="13" fgColor="004080" bgcolor="FFFFFF" fontname="" fontstyle="1" />
- <WordsStyle name="KEYWORD1" styleid="5" fgColor="004080" bgcolor="FFFFFF" fontname="" fontstyle="1" />
- <WordsStyle name="KEYWORD2" styleid="6" fgColor="004080" bgcolor="FFFFFF" fontname="" fontstyle="1" />
- <WordsStyle name="KEYWORD3" styleid="7" fgColor="004080" bgcolor="FFFFFF" fontname="" fontstyle="1" />
- <WordsStyle name="KEYWORD4" styleid="8" fgColor="004080" bgcolor="FFFFFF" fontname="" fontstyle="1" />
- <WordsStyle name="COMMENT" styleid="1" fgColor="008000" bgcolor="FFFFFF" fontname="" fontstyle="2" />
- <WordsStyle name="COMMENT LINE" styleid="2" fgColor="008000" bgcolor="FFFFFF" fontname="" fontstyle="2" />
- <WordsStyle name="NUMBER" styleid="4" fgColor="800000" bgcolor="FFFFFF" fontname="" fontstyle="0" />
- <WordsStyle name="DELIMINER1" styleid="14" fgColor="FF0000" bgcolor="FFFFFF" fontname="" fontstyle="0" />
- <WordsStyle name="DELIMINER2" styleid="15" fgColor="800080" bgcolor="FFFFFF" fontname="" fontstyle="0" />
- <WordsStyle name="DELIMINER3" styleid="16" fgColor="000000" bgcolor="FFFFFF" fontname="" fontstyle="0" />
- </Styles>
- </UserLang>
- </NotepadPlus>
2、在Notepad++中,点菜单:语言->自定义语言格式->导入,选择第1步中创建的文件,导入。
3、关闭Notepad++,然后重新打开,在菜单:语言->自定义语言格式下出现一个“scala”的新菜单项,设置成功。
相关推荐
匆匆那些年 2020-10-15
TheBigBlue 2020-07-28
shenwenjie 2020-07-07
muhongdi 2020-07-07
waitwolf 2020-07-08
yunfenglee 2020-07-08
yunfenglee 2020-07-08
kekeromer 2020-07-08
匆匆那些年 2020-07-07
liqinglin0 2020-07-05
TheBigBlue 2020-07-05
kekeromer 2020-06-13
zhixingheyitian 2020-06-08
TheBigBlue 2020-06-06
liqinglin0 2020-06-01
liqinglin0 2020-06-01
yunfenglee 2020-05-30
MICKEYSTUDY 2020-05-28
muhongdi 2020-05-19