" Language: Texte Convivial Technique (TCT) " License: GNU General Public License, version 3 or later (at your option) " Maintainer: Julien Moutinho " URL: git://git.autogeree.net/hdoc " Version: v2017-08-24 " Installation: " Copy this file to ~/.vim/syntax/tct.vim " then add this line to ~/.vimrc : " autocmd BufNewFile,BufRead *.tct set filetype=tct if exists("b:current_syntax") finish endif syn clear syn sync fromstart syn sync linebreaks=1 " Default syn match tctPlain /.\+/ contains=@tctInline hi def link tctPlain Normal " Block syn match tctPath /^\( *\([^<>:=|  *`«»/"_,.;@^!?~%(){}[\]\\#&+]* *[:>]\|\[[^]]*\]\|- \|\( *\d\+\.\)\+\)\)* *\ze\([^<>:=|  *`«»/"_,.;@^!?~%(){}[\]\\#&+]* *\([>=|@]\|: \|:$\)\|\[[^]]*\]\|-- \|- \|\( *\d\+\.\)\+\|#\+ \)/ \ contains=tctHeaderBird,tctHeaderColon,tctHeaderComment,tctHeaderUL,tctHeaderOL,tctHeaderBracket \ nextgroup=@tctRowPath syn cluster tctRowPath \ contains=tctRowAt,tctRowBird,tctRowColon,tctRowEqual,tctRowBar,tctRowComment,tctRowUL,tctRowOL,tctRowBracket,tctRowSection syn match tctRowAt /[^<>:=|  ]* *@/ contained contains=tctHeaderAt nextgroup=tctValueAt syn match tctRowBar /[^<>:=|  ]* *|/ contained contains=tctHeaderBar nextgroup=tctValueBar syn match tctRowBird /[^<>:=|  ]* *>/ contained contains=tctHeaderBird nextgroup=tctValueBird syn match tctRowColon /[^<>:=|  ]* *:\ze\( \|$\)/ contained contains=tctHeaderColon nextgroup=tctValueColon syn match tctRowEqual /[^<>:=|  ]* *=/ contained contains=tctHeaderEqual nextgroup=tctValueEqual syn match tctRowBracket /\[[^]]*\]/ contained contains=tctHeaderBracket nextgroup=tctValueBracket syn match tctRowComment /-- / contained contains=tctHeaderComment nextgroup=tctValueComment syn match tctRowUL /-\ze / contained contains=tctHeaderUL nextgroup=tctValueUL syn match tctRowOL /\( *\d\+\.\)\+\ze\( \|$\)/ contained contains=tctHeaderOL nextgroup=tctValueOL syn match tctRowSection /#\+\ze / contained contains=tctHeaderSection nextgroup=tctValueSection syn match tctHeaderAt /[^<>:=| ]* *@/ contained contains=tctSymAt,tctSymDot syn match tctHeaderBar /[^<>:=| ]* *|/ contained contains=tctSymBar,tctSymDot syn match tctHeaderBird /[^<>:=| ]* *>/ contained contains=tctSymBird,tctSymDot syn match tctHeaderColon /[^<>:=| ]* *:\ze\( \|$\)/ contained contains=tctSymColon,@tctColons,tctSymDot syn match tctHeaderEqual /[^<>:=| ]* *=/ contained contains=tctSymEqual,tctSymDot syn match tctHeaderBracket /\[[^]]*\]/ contained contains=tctSymBracket,@tctInline syn match tctHeaderComment /--/ contained syn match tctHeaderUL /-/ contained syn match tctHeaderOL /\( *\d\+\.\)\+/ contained contains=tctSymDot syn match tctHeaderSection /#\+/ contained syn match tctSymAt /@/ contained syn match tctSymBar /|/ contained syn match tctSymBird />/ contained syn match tctSymColon /:/ contained syn match tctSymDot /[.]/ contained syn match tctSymEqual /=/ contained syn match tctSymBracket /\(\[\|\]\)/ contained syn match tctValueAt /.*/ contained contains=@tctURL syn match tctValueBar /.*/ contained syn match tctValueBird /.*/ contained contains=@tctInline syn match tctValueColon /.*/ contained contains=@tctInline syn match tctValueEqual /.*/ contained contains=@tctInline syn match tctValueBracket /.*/ contained contains=@tctInline syn match tctValueComment /.*/ contained syn match tctValueUL /.*/ contained contains=@tctInline syn match tctValueOL /.*/ contained contains=@tctInline syn match tctValueSection /.*/ contained contains=@tctInline "syn match tctSection /^ *#\+ .*/ contains=@tctInline hi tctHeaderAt cterm=NONE ctermfg=yellow guifg=yellow hi tctHeaderBar cterm=NONE ctermfg=DarkYellow guifg=yellow hi tctHeaderBird cterm=NONE ctermfg=DarkYellow guifg=yellow hi tctHeaderColon cterm=bold ctermfg=yellow guifg=yellow hi tctHeaderEqual cterm=bold ctermfg=DarkGrey guifg=yellow hi tctHeaderBracket cterm=NONE ctermfg=NONE guifg=NONE hi tctHeaderComment cterm=bold ctermfg=DarkGrey guifg=grey hi tctHeaderUL cterm=bold ctermfg=yellow guifg=yellow hi tctHeaderOL cterm=bold ctermfg=yellow guifg=yellow hi tctHeaderSection cterm=bold ctermfg=magenta guifg=magenta gui=bold hi tctSymAt cterm=bold ctermfg=cyan guifg=cyan hi tctSymBar cterm=bold ctermfg=cyan guifg=cyan hi tctSymBird cterm=bold ctermfg=cyan guifg=cyan hi tctSymColon cterm=bold ctermfg=cyan guifg=cyan hi tctSymDot cterm=bold ctermfg=DarkGrey guifg=grey hi tctSymEqual cterm=bold ctermfg=cyan guifg=cyan hi tctSymBracket cterm=bold ctermfg=cyan guifg=cyan hi tctValueAt cterm=bold gui=bold hi def link tctValueBar Normal hi tctValueColon cterm=bold gui=bold hi tctValueBird cterm=NONE gui=NONE hi tctValueEqual cterm=NONE gui=NONE hi tctValueComment ctermfg=DarkGrey cterm=bold gui=NONE guifg=grey hi tctValueUL cterm=NONE gui=NONE hi tctValueOL cterm=NONE gui=NONE hi tctComment cterm=bold ctermfg=DarkGrey guifg=grey hi tctRowSection cterm=bold ctermfg=magenta guifg=magenta gui=bold hi tctValueSection cterm=bold ctermfg=magenta guifg=magenta gui=bold " Semantic node names, these are not necessary but improves the view. syn cluster tctColons contains=tctColonDONE,tctColonSOLVED,tctColonTODO syn match tctColonDONE /\]\+\/\?>/ \ contained contains=tctESym,tctEAttr syn match tctESym \ /[]/ \ contained syn match tctEAttr \ / [^=]\+="[^"]*"/ \ contained syn match tctQuoteFrench \ /«.\{-}»/ \ contained contains=@tctInline syn match tctItalic \ /\(^\|[  *`’«»"'’|_,.:…;@^!?=~<>%(){}[\]\\#&+-]\)\zs\/[^ /]\([^/]*[^ /]\)\?\/\ze\([  *`’«»"'’|_,.:…;@^!?=~<>%(){}[\]\\#&+-]\|$\)/ \ contained contains=@tctInline syn match tctQuote \ /\(^\|[  *`’«»/'’|_,.:…;@^!?=~<>%(){}[\]\\#&+-]\)\zs"[^ "]\([^"]*[^ "]\)\?"\ze\([  *`’«»/'’|_,.:…;@^!?=~<>%(){}[\]\\#&+-]\|$\)/ \ contained contains=@tctInline syn match tctTag \ /\(^\|[  *`’«»/"'’|_,.:…;@^!?=~<>%(){}[\]\&+-]\)\zs#\([^ #]\([^#]*[^ #]\)\?#\|[^ #]*[^# *`’«»/"'’|_,.:…;@^!?=~<>%(){}[\]\\&+-]\)\ze\([  *`’«»/"'’|_,.:…;@^!?=~<>%(){}[\]\&+-]\|$\)/ \ contained contains=@tctInline syn match tctRRef \ /\(^\|[  *`’«»/"'’|_,.:…;@^!?=~<>%(){}\\#&+-]\)\zs\[[^[\]   ]*\]\ze\([  *`’«»/"'’|_,.:…;@^!?=~<>%(){}\\#&+-]\|$\)/ \ contained contains=@tctInline syn match tctUnderline \ /\(^\|[  *`’«»/"'’|,.:…;@!?=~<>%(){}[\]\\#&+-]\)\zs_.*_\ze\([  *`’«»/"'’|,.:…;@!?=~<>%(){}[\]\\#&+-]\|$\)/ \ contained contains=@tctInline syn match tctURL \ /[a-z+-]\+:\/\/[^| \t[\]]*\(\[[^\]]*\]\)\?/ \ contained contains=tctURLText syn match tctURLText \ /\(\[\zs[^\]]*\ze\]\)\?/ \ contained contains=@tctInline syn match tctEntity "&[^; \t]*;" contained contains=tctEntityPunct syn match tctEntityPunct contained "[&.;]" syn region tctElem \ matchgroup=tctElem start=/<\ze[^ /!?<>"']/ \ matchgroup=tctElem end=/>/ \ contained contains=tctElemName,tctAttr,tctSymEqual,tctAttrValue syn region tctElemEnd \ matchgroup=tctElem start=/<\/\ze[^ /!?<>"']/ \ matchgroup=tctElem end=/>/ \ contained contains=tctElemName,tctAttrPunct syn match tctNamespace \ +\(<\|"':]\+\ze[:]+ \ contained syn match tctElemName \ /\(<\|<\/\)\@2<=[^ /!?<>"']\+/ \ contained contains=tctNamespace,tctAttrPunct syn match tctAttr \ +[-'"<]\@1\%(['">]\@!\|$\)+ \ contained contains=tctAttrPunct syn match tctAttrPunct +[:.]+ contained syn region tctAttrValue contained start=+"+ end=+"+ contains=tctEntity syn region tctAttrValue contained start=+'+ end=+'+ contains=tctEntity syn cluster tctInline contains=tctBold,tctCode,tctElem,tctElemEnd,tctEntity,tctQuoteFrench,tctItalic,tctQuote,tctTag,tctRref,tctUnderline,tctURL hi def link tctAttr Type hi def link tctAttrPunct Comment hi tctBold cterm=bold gui=bold hi tctCode cterm=reverse ctermfg=white gui=reverse hi tctESym cterm=bold ctermfg=cyan guifg=cyan hi def link tctEntity Statement hi def link tctEntityPunct Type hi tctItalic cterm=italic gui=italic hi def link tctNamespace Tag hi tctQuote cterm=bold ctermfg=cyan guifg=cyan hi tctQuoteFrench cterm=bold ctermfg=green guifg=green hi tctTag cterm=bold ctermfg=cyan guifg=cyan hi tctRref ctermfg=cyan cterm=NONE guifg=DarkCyan hi def link tctElem Function hi def link tctElemEnd Identifier hi tctElemName cterm=bold ctermfg=yellow guifg=yellow hi def link tctAttrValue String hi def link tctTodo Todo hi def link tctURL Macro hi def link tctURLText tctNormal hi tctUnderline cterm=underline gui=underline let b:current_syntax = "tct"