notepad++具有許多語言格式,如xml、sql、Java等,方便更清楚地理解代碼結構。但像scala這種新語言,notepad++還未處理,所以需要用戶設置自定義的語言格式。
下面以scala為例進行說明(推薦學習:notepad++)
網上找一個scala的notepad++模板,這里貼一個demo
<NotepadPlus><br/> <UserLang name="Scala" ext="scala"><br/> <Settings><br/> <Global caseIgnored="no" /><br/> <TreatAsSymbol comment="no" commentLine="yes" /><br/> <Prefix words1="no" words2="no" words3="no" words4="no" /><br/> </Settings><br/> <KeywordLists><br/> <Keywords name="Delimiters">"'0"'0</Keywords><br/> <Keywords name="Folder+">{</Keywords><br/> <Keywords name="Folder-">}</Keywords><br/> <Keywords name="Operators">- ! " # % & @ | ~ + < = ></Keywords><br/> <Keywords name="Comment">1/* 1/** 2*/ 2*/ 0//</Keywords><br/> <Keywords name="Words1">class def extends forSome import object package trait type val var with</Keywords><br/> <Keywords name="Words2">boolean byte char double float int long short false new null super this true</Keywords><br/> <Keywords name="Words3">case catch do else finally for if match requires return throw try while yield</Keywords><br/> <Keywords name="Words4">abstract final implicit lazy override private protected sealed</Keywords><br/> </KeywordLists><br/> <Styles><br/> <WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" /><br/> <WordsStyle name="FOLDEROPEN" styleID="12" fgColor="004080" bgColor="FFFFFF" fontName="" fontStyle="1" /><br/> <WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="004080" bgColor="FFFFFF" fontName="" fontStyle="1" /><br/> <WordsStyle name="KEYWORD1" styleID="5" fgColor="004080" bgColor="FFFFFF" fontName="" fontStyle="1" /><br/> <WordsStyle name="KEYWORD2" styleID="6" fgColor="004080" bgColor="FFFFFF" fontName="" fontStyle="1" /><br/> <WordsStyle name="KEYWORD3" styleID="7" fgColor="004080" bgColor="FFFFFF" fontName="" fontStyle="1" /><br/> <WordsStyle name="KEYWORD4" styleID="8" fgColor="004080" bgColor="FFFFFF" fontName="" fontStyle="1" /><br/> <WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="2" /><br/> <WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="2" /><br/> <WordsStyle name="NUMBER" styleID="4" fgColor="800000" bgColor="FFFFFF" fontName="" fontStyle="0" /><br/> <WordsStyle name="DELIMINER1" styleID="14" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="0" /><br/> <WordsStyle name="DELIMINER2" styleID="15" fgColor="800080" bgColor="FFFFFF" fontName="" fontStyle="0" /><br/> <WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" /><br/> </Styles><br/> </UserLang><br/></NotepadPlus><br/>
notepad++中找到語言-自定義語言格式-導入,選擇模板(xml格式)點擊打開(確定)
重啟notepad++,點擊語言就可看到自定義的語言格式
? 版權聲明
文章版權歸作者所有,未經允許請勿轉載。
THE END