| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055 |
- " 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
- " Increase minlines to avoid highlighting errors
- syntax sync minlines=200
- " 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 #unpathdir
- " }}}
- " 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=ttHistSub
- \ skipwhite skipempty
- syntax keyword ttCmdInput #cursor
- \ nextgroup=ttCursorBlock
- \ skipwhite skipempty
- syntax keyword ttCmdInput #buffer
- \ nextgroup=ttBufferSub
- \ 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 #loc[al]
- \ 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 #show[me]
- \ nextgroup=ttValueBlock
- \ skipwhite skipempty
- syntax keyword ttCmd #echo
- \ nextgroup=ttEchoBlock
- \ skipwhite skipempty
- " }}}
- " Path: #path {{{
- syntax keyword ttCmd #path
- \ nextgroup=ttPathSub
- \ skipwhite skipempty
- " }}}
- " Log: #log {{{
- syntax keyword ttCmd #log
- \ nextgroup=ttLogSub
- \ skipwhite skipempty
- " }}}
- " Line: #line {{{
- syntax keyword ttCmd #line
- \ nextgroup=ttLineSub
- \ skipwhite skipempty
- " }}}
- " UnCommands: #un* {{{
- syntax keyword ttCmdUn #unl[ocal] #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
- " }}}
- " Map: #map {{{
- syntax keyword ttCmd #map
- \ nextgroup=ttMapSub
- \ skipwhite skipempty
- " }}}
- 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=ttClassSub
- syntax region ttClassNameBlock
- \ matchgroup=ttBraces start=/{/ end=/}/
- \ contained
- \ skipwhite
- \ nextgroup=ttClassSub
- syntax match ttClassSub "\c\%[{]\(open\|close\|kill\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- syntax match ttClassSub "\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
- " }}}
- " Map Block {{{
- syntax match ttMapSub "\c\%[{]\(at\|create\|destroy\|info\|jump\|find\|flag\|get\|goto\|leave\|legend\|list\|map\|name\|resize\|return\|run\|undo\|vnum\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- syntax match ttMapSub "\c\%[{]\(read\|write\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite skipempty
- \ nextgroup=ttFileNameBlock,ttFileName
- syntax match ttMapSub "\c\%[{]color\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite skipempty
- \ nextgroup=ttMapSubSubColor
- syntax match ttMapSub "\c\%[{]flag\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite skipempty
- \ nextgroup=ttMapSubSubFlag
- syntax match ttMapSub "\c\%[{]\(delete\|dig\|exit\%[flag]\|explore\|insert\|link\|move\|travel\|uninsert\|unlink\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite skipempty
- \ nextgroup=ttMapSubSubDirection
- syntax match ttMapSub "\c\%[{]roomflag\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite skipempty
- \ nextgroup=ttMapSubSubRoomFlag
- syntax match ttMapSub "\c\%[{]set\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite skipempty
- \ nextgroup=ttMapSubSubSet
- syntax match ttMapSubSubColor "\c\%[{]\(exit\|here\|path\|room\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- syntax match ttMapSubSubFlag "\c\%[{]\(asciigraphics\|asciivnums\|mudfont\|nofollow\|static\|symbolgraphics\|vtmap\|vtgraphics\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- syntax match ttMapSubSubDirection "\c\%[{]\(ne\|nw\|se\|sw\|n\|s\|e\|w\|w\|u\|d\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- syntax match ttMapSubSubRoomFlag "\c\%[{]\(avoid\|hide\|leave\|void\|static\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- syntax match ttMapSubSubSet "\c\%[{]room\(area\|color\|data\|desc\|flags\|name\|note\|symbol\|terrain\|weight\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- " }}}
- " Path Block {{{
- syntax match ttPathSub "\c\%[{]\(end\|del\|new\|run\|show\|walk\|zip\|unzip\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- syntax match ttPathSub "\c\%[{]\(load\|save\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite
- \ nextgroup=ttPathVarBlock,ttPathVar
- syntax match ttPathSub "\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 ttBufferSub "\c\%[{]\(clear\|down\|end\|find\|home\|info\|lock\|up\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- syntax match ttBufferSub "\c\%[{]write\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite
- \ nextgroup=ttFileNameBlock,ttFileName
- syntax match ttBufferSub "\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 ttHistSub "\c\%[{]\(delete\|list\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- syntax match ttHistSub "\c\%[{]insert\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite
- \ nextgroup=ttValueBlock
- syntax match ttHistSub "\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 ttLineSub "\c\%[{]\(gag\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- syntax match ttLineSub "\c\%[{]\(strip\|ignore\|verbose\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- syntax match ttLineSub "\c\%[{]\(sub\%[titute]\)\%[}]"
- \ contained
- \ contains=ttSubBrace
- \ skipwhite
- \ nextgroup=ttLineSubSub
- syntax match ttLineSub "\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]\{-}[acdfghlmnprstuwxADHLMSTUX]"
- \ 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_][a-zA-Z0-9_.-]*"
- \ nextgroup=ttVarIndex
- \ containedin=ALLBUT,ttComment,ttNopComment
- syntax match ttVar "&\%[{][a-zA-Z_][a-zA-Z0-9_.-]*"
- \ nextgroup=ttVarIndex
- \ containedin=ALLBUT,ttComment,ttNopComment
- syntax match ttVar "\*\%[{][a-zA-Z_][a-zA-Z0-9_.-]*"
- \ 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_][a-zA-Z0-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 ttBraces
- 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 ttPathSub ttKeyword
- hi link ttLogSub ttKeyword
- hi link ttClassSub ttKeyword
- hi link ttHistSub ttKeyword
- hi link ttEventBlock ttKeyword
- hi link ttCursorBlock ttKeyword
- hi link ttBufferSub ttKeyword
- hi link ttLineSub ttKeyword
- hi link ttLineSubSub ttKeyword
- hi link ttMapSub ttKeyword
- hi link ttMapSubSubSet ttKeyword
- hi link ttMapSubSubColor ttKeyword
- hi link ttMapSubSubFlag ttKeyword
- hi link ttMapSubSubRoomFlag ttKeyword
- hi link ttMapSubSubDirection 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"
|