Re: Syntaxhervorhebung mit UltraEdit
Verfasst: 18.05.2012, 07:38
Heimautomation mit ELV HomeMatic und FHZ Funk-Hauszentralen
https://homematic-forum.de/forum/
Code: Alles auswählen
<NotepadPlus>
<UserLang name="HomeMaticScript" ext="hms">
<Settings>
<Global caseIgnored="no" />
<TreatAsSymbol comment="no" commentLine="no" />
<Prefix words1="no" words2="no" words3="no" words4="no" />
</Settings>
<KeywordLists>
<Keywords name="Delimiters">"00"00</Keywords>
<Keywords name="Folder+"></Keywords>
<Keywords name="Folder-"></Keywords>
<Keywords name="Operators">- # & ( ) * . / ; [ ] { | } + < = ></Keywords>
<Keywords name="Comment">1 2 0! 0</Keywords>
<Keywords name="Words1">else false foreach if true while WriteLine quit</Keywords>
<Keywords name="Words2">boolean integer real string time var object</Keywords>
<Keywords name="Words3">Address Channel Channels ChnGroupPartnerId ChnDirection ChnAESActive ChnArchive ChnRoom ChnFunction Count Date Device DPs DPByHssDP Exec EnumUsedIDs EnumUsedNames Get GetAt GetObject GetVar Find Format ID IsTypeOf IsVar Interface HssType LastValue Length Name Operations ProgramExecute Split State StrValueByIndex Substr Timestamp ToFloat ToInteger ToString ToTime Type TypeName Value ValueType Variable VarType</Keywords>
<Keywords name="Words4">OT_OBJECT OT_ENUM OT_DEVICE OT_CHANNEL OT_DP OT_VARDP $this$ $src$ OPERATION_READ OPERATION_WRITE OPERATION_EVENT</Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="FOLDEROPEN" styleID="12" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="KEYWORD1" styleID="5" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="KEYWORD2" styleID="6" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="KEYWORD3" styleID="7" fgColor="8080FF" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="KEYWORD4" styleID="8" fgColor="FF8080" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="COMMENT" styleID="1" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="COMMENT LINE" styleID="2" fgColor="000000" bgColor="C0C0C0" fontName="" fontStyle="0" />
<WordsStyle name="NUMBER" styleID="4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="OPERATOR" styleID="10" fgColor="800040" bgColor="FFFFFF" fontName="" fontStyle="1" />
<WordsStyle name="DELIMINER1" styleID="14" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
<WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
</Styles>
</UserLang>
</NotepadPlus>
DANKE.mtj hat geschrieben:Da UltraEdit mir doch etwas zu teuer war, habe ich mir Notepad++ mal angesehen. Und dank der wunderbaren Vorarbeit von HomeMaster war es nicht schwer, eine entsprechende Syntaxdatei für Notepad++ anzulegen:
...
Code: Alles auswählen
<NotepadPlus>
<UserLang name="HomeMatic" ext="hms" udlVersion="2.0">
<Settings>
<Global caseIgnored="no" allowFoldOfComments="no" forceLineCommentsAtBOL="no" foldCompact="no" />
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
</Settings>
<KeywordLists>
<Keywords name="Comments" id="0">03 04 00! 00 01 02</Keywords>
<Keywords name="Numbers, additional" id="1"></Keywords>
<Keywords name="Numbers, prefixes" id="2"></Keywords>
<Keywords name="Numbers, extras with prefixes" id="3"></Keywords>
<Keywords name="Numbers, suffixes" id="4"></Keywords>
<Keywords name="Operators1" id="5">- # & ( ) * . / ; [ ] | + < = ></Keywords>
<Keywords name="Operators2" id="6"></Keywords>
<Keywords name="Folders in code1, open" id="7">{</Keywords>
<Keywords name="Folders in code1, middle" id="8"></Keywords>
<Keywords name="Folders in code1, close" id="9">}</Keywords>
<Keywords name="Folders in code2, open" id="10"></Keywords>
<Keywords name="Folders in code2, middle" id="11"></Keywords>
<Keywords name="Folders in code2, close" id="12"></Keywords>
<Keywords name="Folders in comment, open" id="13"></Keywords>
<Keywords name="Folders in comment, middle" id="14"></Keywords>
<Keywords name="Folders in comment, close" id="15"></Keywords>
<Keywords name="Keywords1" id="16">else false foreach if true while WriteLine quit</Keywords>
<Keywords name="Keywords2" id="17">boolean integer real string time var object</Keywords>
<Keywords name="Keywords3" id="18">Address Channel Channels ChnGroupPartnerId ChnDirection ChnAESActive ChnArchive ChnRoom ChnFunction Count Date Device DPs DPByHssDP Exec EnumUsedIDs EnumUsedNames Get GetAt GetObject GetVar Find Format ID IsTypeOf IsVar Interface HssType LastValue Length Name Operations ProgramExecute Split State StrValueByIndex Substr Timestamp ToFloat ToInteger ToString ToTime Type TypeName Value ValueType Variable VarType</Keywords>
<Keywords name="Keywords4" id="19">OT_OBJECT OT_ENUM OT_DEVICE OT_CHANNEL OT_DP OT_VARDP $this$ $src$ OPERATION_READ OPERATION_WRITE OPERATION_EVENT</Keywords>
<Keywords name="Keywords5" id="20"></Keywords>
<Keywords name="Keywords6" id="21"></Keywords>
<Keywords name="Keywords7" id="22"></Keywords>
<Keywords name="Keywords8" id="23"></Keywords>
<Keywords name="Delimiters" id="24">00" 01 02" 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
</KeywordLists>
<Styles>
<WordsStyle name="DEFAULT" styleID="0" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="COMMENTS" styleID="1" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="LINE COMMENTS" styleID="2" fgColor="000000" bgColor="C0C0C0" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="NUMBERS" styleID="3" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS1" styleID="4" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS2" styleID="5" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS3" styleID="6" fgColor="8080FF" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
<WordsStyle name="KEYWORDS4" styleID="7" fgColor="FF8080" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS5" styleID="8" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS6" styleID="9" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS7" styleID="10" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="KEYWORDS8" styleID="11" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="OPERATORS" styleID="12" fgColor="FF8000" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
<WordsStyle name="FOLDER IN CODE1" styleID="13" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="FOLDER IN CODE2" styleID="14" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="FOLDER IN COMMENT" styleID="15" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS1" styleID="16" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS2" styleID="17" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS3" styleID="18" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS4" styleID="19" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS5" styleID="20" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS6" styleID="21" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS7" styleID="22" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
<WordsStyle name="DELIMITERS8" styleID="23" fgColor="000000" bgColor="FFFFFF" fontStyle="0" nesting="0" />
</Styles>
</UserLang>
</NotepadPlus>
Den oben stehenden Code einfach in eine Textdatei (z.B. "HomeMaticScript.xml") kopieren. Dann in Notepad++ im Menü Ansicht/Benutzerdefinierte Sprache... auswählen, dort auf Importieren klicken und die Textdatei auswählen. Textdateien mit der Endung .hms werden nun automatisch mit der entsprechenden farbigen Markierung versehen.