| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985 |
- " VIM Syntax file for tintin++ scripts
- " TODO
- " Add proper support for #chat
- " Add proper support for #map
- " Finish support for #buffer get
- " Make Better use of Clusters
- " Porper #script support, I feel none is better than the fragile support from
- " before
- " Test vs various code styles
- " Add bad syntax highlights to ttError
- if version < 600
- syntax clear
- elseif exists("b:current_syntax")
- finish
- endif
- " Sets the '#' character as a valid keyword character
- setlocal iskeyword+=#
- " tintin++ keywords are case insensitive
- syntax case ignore
- " tintin++ Commands {{{
- " Kill: #kill #killall {{{
- syntax keyword ttCmd #kill
- \ nextgroup=ttListNameKill
- \ skipwhite skipempty
- syntax keyword ttCmd #killall
- \ nextgroup=ttListName
- \ skipwhite skipempty
- " }}}
- " Debugging: #ignore #debug #message {{{
- syntax keyword ttCmdDebug #ignore #debug #message
- \ nextgroup=ttListName,ttListNameBlock
- \ skipwhite skipempty
- " }}}
- " Useless For Scripting: #grep #help #greeting #info {{{
- syntax keyword ttCmdUseless #grep #help #greeting #info
- " }}}
- " Misc tintin commands: #cr #bell #send #split #system #config #pathdir {{{
- syntax keyword ttCmd #cr #bell
- syntax keyword ttCmd #send
- \ nextgroup=ttValueBlock
- \ skipwhite skipempty
- syntax keyword ttCmd #split
- \ nextgroup=ttSplitValueBlock
- \ skipwhite skipempty
- syntax keyword ttCmd #system
- \ nextgroup=ttShellCmd
- \ skipwhite skipempty
- syntax keyword ttCmd #config
- \ nextgroup=ttConfigBlock
- \ skipwhite skipempty
- syntax keyword ttCmd #pathdir
- " }}}
- " End/Suspend: #end #suspend #zap {{{
- syntax keyword ttCmd #end #suspend
- syntax keyword ttCmd #zap
- \ nextgroup=ttSessionName,ttSessionNameBlock
- \ skipwhite skipempty
- " }}}
- " Session Related: #all #gts #snoop #session #run {{{
- syntax keyword ttCmd #all #gts
- syntax match ttCmd "\c#{gts}"
- syntax keyword ttCmd #snoop
- \ nextgroup=ttSessionName,ttSessionNameBlock
- \ skipwhite skipempty
- syntax keyword ttCmd #ses[sion]
- \ nextgroup=ttSesSessionNameBlock,ttSesSessionName
- \ skipwhite skipempty
- syntax keyword ttCmd #run
- \ nextgroup=ttRunSessionNameBlock,ttRunSessionName
- \ skipwhite skipempty
- " }}}
- " Looping Commands #while #loop #forall #foreach #parse #break #continue {{{
- syntax keyword ttCmdLoop #break #continue
- syntax keyword ttCmdLoop #while
- \ nextgroup=ttExpressionBlock
- \ skipwhite skipempty
- syntax keyword ttCmdLoop #forall
- \ nextgroup=ttForAllBlock
- \ skipwhite skipempty
- syntax keyword ttCmdLoop #foreach
- \ nextgroup=ttForEachBlock
- \ skipwhite skipempty
- syntax keyword ttCmdLoop #loop
- \ nextgroup=ttLoopLowerBlock
- \ skipwhite skipempty
- syntax keyword ttCmdLoop #parse
- \ nextgroup=ttParseValueBlock
- \ skipwhite skipempty
- " }}}
- " Triggers On Game Output #act #high #sub #event {{{
- syntax keyword ttCmdTrigger #act[ion] #gag
- \ nextgroup=ttPatternBlock
- \ skipwhite skipempty
- syntax keyword ttCmdTrigger #high[light]
- \ nextgroup=ttPatternBlockHigh
- \ skipwhite skipempty
- syntax keyword ttCmdTrigger #sub[stitute] #prompt
- \ nextgroup=ttPatternBlockSub
- \ skipwhite skipempty
- syntax keyword ttCmdTrigger #event
- \ nextgroup=ttEventBlock
- \ skipwhite skipempty
- " }}}
- " Input Related: #alias #tab #macro #history #cursor #buffer {{{
- syntax keyword ttCmdInput #alias
- \ nextgroup=ttPatternBlock
- \ skipwhite skipempty
- syntax keyword ttCmdInput #tab
- \ nextgroup=ttValueBlock
- \ skipwhite skipempty
- syntax keyword ttCmdInput #macro
- \ nextgroup=ttKeyBlock
- \ skipwhite skipempty
- syntax keyword ttCmdInput #hist[ory]
- \ nextgroup=ttHistSub1,ttHistSub2,ttHistSub3
- \ skipwhite skipempty
- syntax keyword ttCmdInput #cursor
- \ nextgroup=ttCursorBlock
- \ skipwhite skipempty
- syntax keyword ttCmdInput #buffer
- \ nextgroup=ttBufferSub1,ttBufferSub2,ttBufferSub3
- \ skipwhite skipempty
- " }}}
- " Switch/Case: #switch #case #default {{{
- syntax keyword ttCmdSwitch #switch #case
- \ nextgroup=ttExpressionBlock
- \ skipwhite skipempty
- syntax keyword ttCmdSwitch #default
- "}}}
- " If/ElseIf/Else Branching: #if #elseif #else {{{
- syntax keyword ttCmdBranch #if #elseif
- \ nextgroup=ttExpressionBlock
- \ skipwhite skipempty
- syntax keyword ttCmdBranch #else
- " }}}
- " File Related: #read #write #scan #textin {{{
- syntax keyword ttCmd #read #write #scan #textin
- \ nextgroup=ttFileNameBlock,ttFileName
- \ skipwhite skipempty
- " }}}
- " Variable Assignment: #var #format #math #regex #repalce #list {{{
- syntax keyword ttCmdVar #var[iable]
- \ nextgroup=ttVarVarBlock,ttVarVar
- \ skipwhite skipempty
- syntax keyword ttCmdVar #format
- \ nextgroup=ttFormatVarBlock,ttFormatVar
- \ skipwhite skipempty
- syntax keyword ttCmdVar #math
- \ nextgroup=ttMathVarBlock,ttMathVar
- \ skipwhite skipempty
- syntax keyword ttCmdVar #regex
- \ nextgroup=ttRegexVarBlock,ttRegexVar
- \ skipwhite skipempty
- syntax keyword ttCmdVar #replace
- \ nextgroup=ttReplaceVarBlock,ttReplaceVar
- \ skipwhite skipempty
- syntax keyword ttCmdVar #list
- \ nextgroup=ttListVarBlock,ttListVar
- \ skipwhite skipempty
- " }}}
- " Functions: #function #return {{{
- syntax keyword ttCmd #func[tion]
- \ nextgroup=ttFunctionNameBlock
- \ skipwhite skipempty
- syntax keyword ttCmd #return
- \ nextgroup=ttValueBlock
- \ skipwhite skipempty
- " }}}
- " Time Realted: #tick #delay {{{
- syntax keyword ttCmdTime #tick[er] #delay
- \ nextgroup=ttTimeNameBlock
- \ skipwhite skipempty
- " }}}
- " Class: #class {{{
- syntax keyword ttCmd #class
- \ nextgroup=ttClassNameBlock,ttClassName
- \ skipwhite skipempty
- " }}}
- " Local Echos: #echo #showme {{{
- syntax keyword ttCmd #showme
- \ nextgroup=ttValueBlock
- \ skipwhite skipempty
- syntax keyword ttCmd #echo
- \ nextgroup=ttEchoBlock
- \ skipwhite skipempty
- " }}}
- " Path: #path {{{
- syntax keyword ttCmd #path
- \ nextgroup=ttPathSub1,ttPathSub2,ttPathSub3
- \ skipwhite skipempty
- " }}}
- " Log: #log {{{
- syntax keyword ttCmd #log
- \ nextgroup=ttLogSub
- \ skipwhite skipempty
- " }}}
- " Line: #line {{{
- syntax keyword ttCmd #line
- \ nextgroup=ttLineSub1,ttLineSub2,ttLineSub3,ttLineSub4
- \ skipwhite skipempty
- " }}}
- " UnCommands: #un* {{{
- syntax keyword ttCmdUn #unvar[iable] #untick[er] #undelay #unact[ion] #unevent #unfunc[tion]
- \ #unhigh[light] #unmacro #unprompt #unsub[sisitue] #untab #ungag #unalias
- \ nextgroup=ttUnBlock,ttUn
- \ skipwhite
- " }}}
- " Repeat Command: #{number} {{{
- syntax match ttCmdRep "#\d\+"
- syntax match ttCmdRep "#{\d\+}"
- " }}}
- " #script is handled in a special way {{{
- syntax keyword ttCmdScript #script
- " }}}
- syntax keyword ttCmd #map
- syntax keyword ttCmd #chat
- " }}}
- syntax case match
- " Cluster ttCmd* into ttCmds {{{
- syntax cluster ttCmds contains=
- \ ttCmd,
- \ ttCmdBranch,
- \ ttCmdDebug,
- \ ttCmdInput,
- \ ttCmdLoop,
- \ ttCmdRep,
- \ ttCmdSwitch,
- \ ttCmdTime,
- \ ttCmdTrigger,
- \ ttCmdUseless,
- \ ttCmdVar,
- \ ttCmdUn,
- \ ttCmdScript,
- " }}}
- " Blocks {{{
- " General Blocks:
- " Pattern Match Blocks {{{
- syntax region ttPatternBlock
- \ matchgroup=ttBracesMatch start=/{/ end=/}/
- \ contained
-
- syntax region ttPatternBlockHigh
- \ matchgroup=ttBracesMatch start=/{/ end=/}/
- \ contained skipwhite skipempty
- \ nextgroup=ttHighColorBlock
- syntax region ttPatternBlockSub
- \ matchgroup=ttBracesMatch start=/{/ end=/}/
- \ contained skipwhite skipempty
- \ nextgroup=ttFormatBlock
- " }}}
- " Format Block {{{
- syntax region ttFormatBlock
- \ matchgroup=ttBracesFormat start=/{/ end=/}/
- \ contained
- syntax region ttReplaceFormatBlock
- \ matchgroup=ttBracesFormat start=/{/ end=/}/
- \ contained
- " }}}
- " Value Blocks {{{
- syntax region ttValueBlock
- \ matchgroup=ttBracesValue start=/{/ end=/}/
- \ contained
- \ contains=ttValueBlock
- syntax region ttSplitValueBlock
- \ matchgroup=ttBracesValue start=/{/ end=/}/
- \ contained skipwhite skipempty
- \ nextgroup=ttValueBlock
- syntax region ttParseValueBlock
- \ matchgroup=ttBracesValue start=/{/ end=/}/
- \ contained skipwhite skipempty
- \ nextgroup=ttLoopVarBlock
- " }}}
- " Expression Block {{{
- syntax region ttExpressionBlock
- \ matchgroup=ttBracesExpression start=/{/ end=/}/
- \ contained
- " }}}
- " File Name Block {{{
- syntax region ttFileNameBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- syntax region ttFileName
- \ start=/\w/ skip=/\\\s/ end=/\( \|$\)/
- \ contained
- \ contains=ttCmdSep
- " }}}
- " Key Block {{{
- syntax region ttKeyBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- " }}}
- " Shell Command Block {{{
- syntax region ttShellCmd
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ contains=ttShellCmd
- " }}}
- " Blocks For Specefic Commands:
- " ListName Blocks {{{
- syntax match ttListName "\c\%[{]\(act\%[ions]\|alias\%[es]\|class\%[es]\|config\%[urations]\|delay\%[s]\|event\%[s]\|func\%[tions]\|gag\[%s]\|high\%[lights]\|hist\%[ories]\|macro\%[s]\|path\%[s]\|pathdirs\|prompt\%[s]\|sub\%[stitutions]\|tab\%[s]\|tabcycle\|ticker\%[s]\|var\%[iables]\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- syntax match ttListNameKill "\c\%[{]\(act\%[ions]\|alias\%[es]\|class\%[es]\|config\%[urations]\|delay\%[s]\|event\%[s]\|func\%[tions]\|gag\[%s]\|high\%[lights]\|hist\%[ories]\|macro\%[s]\|path\%[s]\|pathdirs\|prompt\%[s]\|sub\%[stitutions]\|tab\%[s]\|tabcycle\|ticker\%[s]\|var\%[iables]\)\%[}]"
- \ contains=ttSubBrace
- \ contained
- \ skipwhite skipempty
- \ nextgroup=ttPatternBlock
- " }}}
- " ForAll/ForEach LoopLower/LoopUpper {{{
- syntax region ttForAllBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ contains=ttValueBlock
- syntax region ttForEachBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ contains=ttValueBlock
- \ skipwhite skipempty
- \ nextgroup=ttLoopVarBlock
- syntax region ttLoopVarBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- syntax region ttLoopLowerBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ skipwhite skipempty
- \ nextgroup=ttLoopUpperBlock
- syntax region ttLoopUpperBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ skipwhite skipempty
- \ nextgroup=ttLoopVarBlock
- " }}}
- " Highlight Color Block {{{
- syntax region ttHighColorBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- " }}}
- " Functions Name Block {{{
- syntax region ttFunctionNameBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- " }}}
- " Variable Name Block {{{
- syntax match ttVarVar "[^ ;]\+"
- \ contained
- \ contains=ttVarIndex
- \ skipwhite
- \ nextgroup=ttValueBlock
- syntax region ttVarVarBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ contains=ttVarIndex
- \ skipwhite
- \ nextgroup=ttValueBlock
- syntax match ttFormatVar "[^ ;]\+"
- \ contained
- \ contains=ttVarIndex
- \ skipwhite
- \ nextgroup=ttFormatBlock
- syntax region ttFormatVarBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ contains=ttVarIndex
- \ skipwhite skipempty
- \ nextgroup=ttFormatBlock
- syntax match ttMathVar "[^ ;]\+"
- \ contained
- \ contains=ttVarIndex
- \ skipwhite
- \ nextgroup=ttExpressionBlock
- syntax region ttMathVarBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ contains=ttVarIndex
- \ skipwhite skipempty
- \ nextgroup=ttExpressionBlock
- syntax match ttMRegexVar "[^ ;]\+"
- \ contained
- \ contains=ttVarIndex
- \ skipwhite
- \ nextgroup=ttFormatBlock
- syntax region ttRegexVarBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ contains=ttVarIndex
- \ skipwhite skipempty
- \ nextgroup=ttPatternBlock
- syntax match ttReplaceVar "[^ ;]\+"
- \ contained
- \ contains=ttVarIndex
- \ skipwhite
- \ nextgroup=ttReplaceFormatBlock
- syntax region ttReplaceVarBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ contains=ttVarIndex
- \ skipwhite skipempty
- \ nextgroup=ttReplaceFormatBlock
- syntax match ttListVar "[^ ;]\+"
- \ contained
- \ contains=ttVarIndex
- \ skipwhite
- \ nextgroup=ttListSub
- syntax region ttListVarBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ contains=ttVarIndex
- \ skipwhite skipempty
- \ nextgroup=ttListSub
- syntax match ttPathVar "[^ ;]\+"
- \ contained
- \ contains=ttVarIndex
- \ skipwhite
- \ nextgroup=ttListSub
- syntax region ttPathVarBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ contains=ttVarIndex
- \ skipwhite skipempty
- \ nextgroup=ttListSub
- " }}}
- " Ticker/Delay Name {{{
- syntax region ttTimeNameBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- " }}}
- " Class Blocks {{{
- syntax match ttClassName "[^ ;]\+"
- \ contained
- \ skipwhite
- \ nextgroup=ttClassSub1,ttClassSub2
- syntax region ttClassNameBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ skipwhite
- \ nextgroup=ttClassSub1,ttClassSub2
- syntax match ttClassSub1 "\c\%[{]\(open\|close\|kill\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- syntax match ttClassSub2 "\c\%[{]\(read\|write\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite
- \ nextgroup=ttFileNameBlock,ttFileName
- " }}}
- " List Block {{{
- syntax match ttListSub "\c\%[{]\(add\|cl\%[ear]\|create\|del\%[ete]\|ins\%[ert]\|get\|set\|size\|sort\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- " }}}
- " Path Block {{{
- syntax match ttPathSub1 "\c\%[{]\(end\|del\|new\|run\|show\|walk\|zip\|unzip\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- syntax match ttPathSub2 "\c\%[{]\(load\|save\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite
- \ nextgroup=ttPathVarBlock,ttPathVar
- syntax match ttPathSub3 "\c\%[{]\(ins\%[ert]\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite
- \ nextgroup=ttValueBlock
- " }}}
- " Log Block {{{
- syntax match ttLogSub "\c\%[{]\(a\%[ppend]\|ov\%[erwrite]\|of\%[f]\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite
- \ nextgroup=ttFileNameBlock,ttFileName
- " }}}
- " Buffer Block {{{
- syntax match ttBufferSub1 "\c\%[{]\(clear\|down\|end\|find\|home\|info\|lock\|up\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- syntax match ttBufferSub2 "\c\%[{]write\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite
- \ nextgroup=ttFileNameBlock,ttFileName
- syntax match ttBufferSub3 "\c\%[{]get\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite
- " }}}
- " Event Name {{{
- syntax region ttEventBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- " }}}
- " Cursor Option {{{
- syntax region ttCursorBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ skipwhite skipempty
- \ nextgroup=ttKeyBlock
- " }}}
- "Session/Run Name Blocks {{{
- syntax match ttSessionName "[^ ;]\+"
- \ contained
- syntax region ttSessionNameBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- syntax match ttSesSessionName "[^ ;]\+"
- \ contained
- \ skipwhite
- \ nextgroup=ttSessionURIBlock,ttSessionURI
- syntax region ttSesSessionNameBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ skipwhite
- \ nextgroup=ttSessionURIBlock,ttSessionURI
- syntax match ttRunSessionName "[^ ;]\+"
- \ contained
- \ skipwhite
- \ nextgroup=ttShellCmd
- syntax region ttRunSessionNameBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ skipwhite
- \ nextgroup=ttShellCmd
- syntax match ttSessionURI "[^ ;]\+"
- \ contained
- \ skipwhite
- \ nextgroup=ttSessionPortBlock,ttSessionPort
- syntax region ttSessionURIBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ skipwhite
- \ nextgroup=ttSessionPortBlock,ttSessionPort
- syntax match ttSessionPort "[^ ;]\+"
- \ contained
- syntax region ttSessionPortBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- " }}}
- " History Block {{{
- syntax match ttHistSub1 "\c\%[{]\(delete\|list\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- syntax match ttHistSub2 "\c\%[{]insert\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite
- \ nextgroup=ttValueBlock
- syntax match ttHistSub3 "\c\%[{]\(write\|read\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite
- \ nextgroup=ttFileNameBlock,ttFileName
- " }}}
- " Echo Block {{{
- syntax region ttEchoBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ contains=ttFormatBlock,ttEchoNumberBlock
- syntax match ttEchoNumberBlock "{\d\+}"
- \ contained
- \ contains=ttCodeBlock
- " }}}
- " RegEx Matching Block {{{
- syntax region ttRegExBlock
- \ matchgroup=ttRegExBraces start=/{/ end=/}/
- \ contained
- \ contains=ttRegExBlock
- \ containedin=ttPatternBlock,ttPatternBlockSub,ttPatternBlockHigh
- " }}}
- " String Block {{{
- syntax region ttString
- \ matchgroup=ttBraces start=/"/ skip=/\\"/ end=/"/
- \ contained
- \ contains=ttRegExBlock
- \ containedin=ttExpressionBlock
- " }}}
- " Config Block {{{
- syntax region ttConfigBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- " }}}
- " Line Block {{{
- syntax match ttLineSub1 "\c\%[{]\(gag\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- syntax match ttLineSub2 "\c\%[{]\(strip\|ignore\|verbose\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- syntax match ttLineSub3 "\c\%[{]\(sub\%[titute]\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite
- \ nextgroup=ttLineSubSub
- syntax match ttLineSub4 "\c\%[{]\(log\%[verbatim]\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite
- \ nextgroup=ttFileNameBlock,ttFileName
- syntax match ttLineSubSub "\c\%[{]\(var\%[iables]\|functions\|colors\|escapes\|secure\|eol\|lnf\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- " }}}
- " Un* Block {{{
- syntax region ttUnBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- syntax match ttUn "[^;{} ]\+"
- \ contained
- " }}}
- " Generic Block:
- " Falls Back To Generic Code Block {{{
- syntax region ttCodeBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contains=ttCodeBlock,ttCmdSep,@ttCmds,ttNopComment
- " }}}
- " Error Block: {{{
- syntax region ttErrorBlock
- \ start=/\S\+/ end=/$\|;/
- \ keepend
- \ contains=ttCmdSep
- \ contained
- " }}}
- " }}}
- " Syntax Elements {{{
- " Numbers {{{
- syntax match ttInt "\d\+"
- \ containedin=ttCodeBlock,ttValueBlock,ttTimeNameBlock,ttExpressionBlock,ttVarIndex,ttLoopLowerBlock,ttLoopUpperBlock,ttFuncBlock,ttSessionPort,ttSessionPortBlock
- syntax match ttFloat "\d\+.\d\+"
- \ containedin=ttCodeBlock,ttValueBlock,ttTimeNameBlock,ttExpressionBlock,ttVarIndex,ttLoopLowerBlock,ttLoopUpperBlock,ttFuncBlock,ttSessionPort,ttSessionPortBlock
- " }}}
- " Lazy Match Patterns {{{
- syntax match ttMatchLazy "%[iIwWdDsS?.+*]"
- \ contained
- \ containedin=ttPatternBlock,ttPatternBlockHigh,ttPatternBlockSub,ttUn,ttUnBlock,ttReplaceFormatBlock,ttString
- " }}}
- " Match Special Regex Chars {{{
- syntax match ttMatchSpecial "\^\|\~\|\$"
- \ contained
- \ containedin=ttPatternBlock,ttPatternBlockHigh,ttPatternBlockSub,ttReplaceFormatBlock
- " }}}
- " Format specifiers {{{
- syntax match ttFormat "%\%[.+-][0-9]\{-}[acdghlmnprstuwACLRTU]"
- \ contained
- \ containedin=ttFormatBlock,ttEchoBlock
- " }}}
- " RexEx {{{
- syntax match ttRegEx "\(\.\|+\|?\|*\||\)"
- \ contained
- \ containedin=ttRegExBlock
- syntax match ttRegExBraces "\()\|(\|\]\|\[\)"
- \ contained
- \ containedin=ttRegExBlock
- " }}}
- " Math and Bitwise Operators {{{
- syntax match ttOperators "\(<<\|>>\|==\|!=\|^^\|||\|&&\|[-+*%&/^|<>!=]\)"
- \ contained
- \ containedin=ttExpressionBlock
- syntax match ttOperatorsParen "[)(]"
- \ contained
- \ containedin=ttExpressionBlock
- " }}}
- " Color codes {{{
- syntax match ttColor "<\d\d\d>"
- \ containedin=ttFormatBlock,ttValueBlock,ttEchoBlock
- syntax match ttColor "<[a-fA-F][a-fA-F][a-fA-F]>"
- \ containedin=ttFormatBlock,ttValueBlock,ttEchoBlock
- syntax match ttColor "<[gG]\d\{2}>"
- \ containedin=ttFormatBlock,ttValueBlock,ttEchoBlock
- " }}}
- " Dynamic Variables {{{
- syntax match ttArgRef "%\d\{1,2}"
- \ containedin=ALLBUT,ttComment,ttNopComment
- syntax match ttRegExRef "&\d\{1,2}"
- \ containedin=ALLBUT,ttComment,ttNopComment
- " }}}
- " Character Escapes {{{
- syntax match ttEsc "\\[0abcenrt\\]"
- \ containedin=ALLBUT,ttComment,ttNopComment
- syntax match ttEsc "\\x\x\{2}"
- \ containedin=ALLBUT,ttComment,ttNopComment
- syntax match ttEsc "\\\d\d\d"
- \ containedin=ALLBUT,ttComment,ttNopComment
- " }}}
- " ANSI Escape/Control Codes {{{
- syntax match ttAnsiEsc /\\e\[[0-9;\\]\{-}m/
- \ containedin=ALLBUT,ttComment,ttNopComment
- " }}}
- " tintin Variables {{{
- syntax match ttVar "\$\%[{][a-zA-Z_]\+"
- \ nextgroup=ttVarIndex
- \ containedin=ALLBUT,ttComment,ttNopComment
- syntax match ttVar "&\%[{][a-zA-Z_]\+"
- \ nextgroup=ttVarIndex
- \ containedin=ALLBUT,ttComment,ttNopComment
- " }}}
- " Variable Blocks {{{
- syntax region ttVarBlock
- \ matchgroup=ttVarBraces start=/${/ end=/}/
- \ contains=ttVarIndex
- \ containedin=ALLBUT,ttComment,ttNopComment
- syntax region ttVarBlock
- \ matchgroup=ttVarBraces start=/&{/ end=/}/
- \ contains=ttVarIndex
- \ containedin=ALLBUT,ttComment,ttNopComment
- " }}}
- " Variable Index {{{
- syntax region ttVarIndex
- \ matchgroup=ttVarIndexBracket start=/\[/ end=/\]/
- \ contained
- \ containedin=ttVarBlock
- \ transparent
- \ nextgroup=ttVarIndex
- " }}}
- " @function calls and the obligatory braces around the arguments {{{
- syntax region ttFuncBlock
- \ matchgroup=ttBracesFunction start=/{/ skip=/$/ end=/}/
- \ contains=ttCodeBlock
- \ contained
- syntax match ttFunction "@[A-Za-z_0-9]\+"
- \ containedin=ALLBUT,ttComment,ttNopComment
- \ nextgroup=ttFuncBlock
- " }}}
- " Optional SubCommand Braces {{{
- syntax match ttSubBrace "{\|}"
- \ contained
- " }}}
- " Command Terminator {{{
- syntax match ttCmdSep /;/
- \ containedin=ttCodeBlock,ttFuncBlock,ttForAllBlock,ttForEachBlock
- " }}}
- " }}}
- " Comments {{{
- " #nop comments
- syntax region ttNopComment
- \ matchgroup=ttNop start="#nop" end=/\;\|$/
- " C-style multi-line comments
- syntax region ttComment start="/\*" end="\*/"
- syntax region ttCommentError start="/\*" end="\*/"
- \ contained
- \ containedin=ttCodeBlock
- " Special notes in Comments
- syntax keyword ttTodo TODO FIXME XXX BUG DEBUG
- \ contained
- \ containedin=ttComment,ttNopComment
- " }}}
- " Internal Highlink Linking {{{
- " Link ttCmd* to ttCmd Group {{{
- hi link ttCmdBranch ttCmd
- hi link ttCmdDebug ttCmd
- hi link ttCmdInput ttCmd
- hi link ttCmdLoop ttCmd
- hi link ttCmdRep ttCmd
- hi link ttCmdSwitch ttCmd
- hi link ttCmdTime ttCmd
- hi link ttCmdTrigger ttCmd
- hi link ttCmdUseless ttCmd
- hi link ttCmdVar ttCmd
- hi link ttCmdUn ttCmd
- hi link ttCmdScript ttCmd
- "}}}
- " Link Syntax Elements {{{
- hi link ttMatchLazy ttMacro
- hi link ttMatchSpecial ttMacro
- hi link ttFormat ttMacro
- hi link ttRegEx ttMacro
- hi link ttRegExBraces ttMacro
- hi link ttColor ttMacro
- hi link ttEsc ttMacro
- hi link ttAnsiEsc ttMacro
- hi link ttArgRef ttReference
- hi link ttRegExRef ttReference
- " }}}
- " tintin Lists and Sub commands are keywords {{{
- hi link ttListNameKill ttKeyword
- hi link ttListName ttKeyword
- hi link ttConfigBlock ttKeyword
- hi link ttListSub ttKeyword
- hi link ttPathSub1 ttKeyword
- hi link ttPathSub2 ttKeyword
- hi link ttPathSub3 ttKeyword
- hi link ttLogSub ttKeyword
- hi link ttClassSub1 ttKeyword
- hi link ttClassSub2 ttKeyword
- hi link ttHistSub1 ttKeyword
- hi link ttHistSub2 ttKeyword
- hi link ttHistSub3 ttKeyword
- hi link ttEventBlock ttKeyword
- hi link ttCursorBlock ttKeyword
- hi link ttBufferSub1 ttKeyword
- hi link ttBufferSub2 ttKeyword
- hi link ttBufferSub3 ttKeyword
- hi link ttLineSub1 ttKeyword
- hi link ttLineSub2 ttKeyword
- hi link ttLineSub3 ttKeyword
- hi link ttLineSub4 ttKeyword
- hi link ttLineSubSub ttKeyword
- " }}}
- hi link ttSessionURIBlock ttSessionURI
- hi link ttSessionURI ttString
- " Link all Braces together {{{
- hi link ttBracesMatch ttBraces
- hi link ttBracesFormat ttBraces
- hi link ttBracesValue ttBraces
- hi link ttBracesExpression ttBraces
- hi link ttVarIndexBracket ttBraces
- hi link ttRegExBraces ttBraces
- hi link ttOperatorsParen ttBraces
- hi link ttSubBrace ttBraces
- " }}}
- hi link ttBracesFunction ttFunction
- " Link Various Variable Names to ttVarName {{{
- hi link ttLoopVarBlock ttVarName
- hi link ttMathVarBlock ttVarName
- hi link ttFormatVarBlock ttVarName
- hi link ttRegexVarBlock ttVarName
- hi link ttReplaceVarBlock ttVarName
- hi link ttVarVarBlock ttVarName
- hi link ttListVarBlock ttVarName
- hi link ttPathVarBlock ttVarName
- hi link ttVarVar ttVarName
- hi link ttMathVar ttVarName
- hi link ttFormatVar ttVarName
- hi link ttRegexVar ttVarName
- hi link ttReplaceVar ttVarName
- hi link ttListVar ttVarName
- hi link ttPathVar ttVarName
- hi link ttScriptVarNameVar ttVarName
- " }}}
- " Link all pattern blocks together {{{
- hi link ttPatternBlockHigh ttPatternBlock
- hi link ttPatternBlockSub ttPatternBlock
- " }}}
- " Link all names to ttIdentifier {{{
- hi link ttClassName ttIdentifier
- hi link ttClassNameBlock ttIdentifier
- hi link ttTimeNameBlock ttIdentifier
- hi link ttSessionName ttIdentifier
- hi link ttSessionNameBlock ttIdentifier
- hi link ttSesSessionName ttIdentifier
- hi link ttSesSessionNameBlock ttIdentifier
- hi link ttRunSessionName ttIdentifier
- hi link ttRunSessionNameBlock ttIdentifier
- hi link ttUnBlock ttIdentifier
- hi link ttUn ttIdentifier
- " }}}
- " Link various number types to ttNumber {{{
- hi link ttInt ttNumber
- hi link ttFloat ttNumber
- " }}}
- hi link ttFunctionNameBlock ttFunction
- hi link ttFileNameBlock ttFileName
- hi link ttScriptShell ttShellCmd
- hi link ttVarBlock ttVar
- hi link ttVarBraces ttVar
- hi link ttNopComment ttComment
- hi link ttNop ttCmd
- hi link ttCommentError ttError
- hi link ttErrorBlock ttError
- " }}}
- " Link tt Highlighting Groups to Default Groups {{{
- hi default link ttVar Special
- hi default link ttCmd Statement
- hi default link ttBraces Delimiter
- hi default link ttCmdSep Delimiter
- hi default link ttFileName Character
- hi default link ttReference Special
- hi default link ttMacro Macro
- hi default link ttKeyword Keyword
- hi default link ttFunction Function
- hi default link ttShellCmd Character
- hi default link ttVarName Identifier
- hi default link ttIdentifier Identifier
- hi default link ttNumber Number
- hi default link ttString String
- hi default link ttOperators Operator
- hi default link ttCodeBlock Structure
- hi default link ttTodo Todo
- hi default link ttComment Comment
- hi default link ttError Error
- " }}}
- let b:current_syntax = "tt"
|