Notepad ++에서 사용자 정의 “사용자 정의”언어를 작성하는 방법 있습니다. 어떻게 사용자 정의합니까? 그러한 옵션의 기능은 무엇입니까? 날짜

메모장 ++에는 언어-> “사용자 정의”메뉴 옵션이 있습니다.

어떻게 사용자 정의합니까? 그러한 옵션의 기능은 무엇입니까?

날짜 / 시간을 강조 표시 할 수 있습니까? 줄에서 21-29 번째 기호를 강조 표시 할 수 있습니까? RegExp를 사용할 수 있습니까?



답변

원하는대로 언어를 정의하고 새로운 프로그래밍 언어를 만들 수 있지만 가장 편리한 방법은 전체 구성을 정의하는 XML 문서를 가져 오는 것입니다. 이 목적을위한 XML 파일은 여기에서 다운로드 할 수 있습니다. http://www.mediafire.com/download/qv84x0wjwn816d6/userDefineLang.xml

그런 다음 다음과 같이 고유 한 구문을 사용하여이 파일을 정의해야합니다.

<?xml version="1.0" encoding="Windows-1252" ?>
<NotepadPlus>
    <UserLang name="(name your language here e.g.P++) " ext="java">
        <Settings>
          <Global caseIgnored="no" />
          <TreatAsSymbol comment="no" commentLine="no"/>
          <Prefix words1="no" words2="no" words3="yes" words4="yes"/>
       </Settings>
        <KeywordLists>
            <Keywords name="Folder+">{</Keywords>
            <Keywords name="Folder-">}</Keywords>
            <Keywords name="Operators">- ( ) * , . / : ? @ [ ] + =</Keywords>
            <Keywords name="Comment">//</Keywords>
            <Keywords name="Words1"></Keywords>
            <Keywords name="Words2"></Keywords>
            <Keywords name="Words3">instanceof assert if else switch case default break goto return for while do continue new throw throws try catch finally this super extends implements import true false null</Keywords>
            <Keywords name="Words4">capsule design package transient strictfp void char short int long double float const static volatile byte boolean class interface native private protected public final abstract synchronized enum</Keywords>
        </KeywordLists>
        <Styles>
            <WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="9" />
            <WordsStyle name="FOLDEROPEN" styleID="12" fgColor="808040" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="14" keywordClass="Folder+"/>
            <WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="808040" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="14" keywordClass="Folder-" />
            <WordsStyle name="KEYWORD3" styleID="7" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" keywordClass="Words3"/>
            <WordsStyle name="KEYWORD4" styleID="8" fgColor="8000FF" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" keywordClass="Words4"/>/>
            <WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" keywordClass="Comment"/>
            <WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000" bgColor="FFFFFF" fontName="Comic Sans MS" fontStyle="0" fontSize="" keywordClass="Comment"/>
            <WordsStyle name="NUMBER" styleID="4" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
            <WordsStyle name="OPERATOR" styleID="10" fgColor="804000" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" />
        </Styles>
    </UserLang>
</NotepadPlus>

그러면 언어 탭에 언어가 표시됩니다.