robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
44c7833193
master
1" Vim syntax file 2" Language: Mermaid 3" Maintainer: Craig MacEahern <https://github.com/craigmac/vim-mermaid> 4" Filenames: *.mmd 5" Last Change: 2023 Dec 26 6 7if exists ( "b:current_syntax" ) 8finish 9endif 10 11let s: cpo_save = & cpo 12set cpo & vim 13 14syntax iskeyword @,48-57,192-255,$,_,-,: 15syntax keyword mermaidKeyword 16 \_blank 17 \_self 18 \_parent 19 \_top 20 \ ::icon 21 \ accDescr 22 \ accTitle 23 \ actor 24 \ activate 25 \ alt 26 \ and 27 \ as 28 \ autonumber 29 \ branch 30 \ break 31 \ callback 32 \ checkout 33 \ class 34 \ classDef 35 \ classDiagram 36 \ click 37 \ commit 38 \ commitgitGraph 39 \ critical 40 \ dataFormat 41 \ dateFormat 42 \ deactivate 43 \ direction 44 \ element 45 \ else 46 \ end 47 \ erDiagram 48 \ flowchart 49 \ gantt 50 \ gitGraph 51 \ graph 52 \ journey 53 \ link 54 \LR 55 \TD 56 \TB 57 \RL 58 \ loop 59 \ merge 60 \ mindmap root 61 \Note 62 \Note right of 63 \Note left of 64 \Note over 65 \ note 66 \ note right of 67 \ note left of 68 \ note over 69 \ opt 70 \ option 71 \ par 72 \ participant 73 \ pie 74 \ rect 75 \ requirement 76 \ rgb 77 \ section 78 \ sequenceDiagram 79 \ state 80 \ stateDiagram 81 \ stateDiagram-v2 82 \ style 83 \ subgraph 84 \ title 85highlight link mermaidKeyword Keyword 86 87syntax match mermaidStatement "| " 88syntax match mermaidStatement "\~\~\~ " 89syntax match mermaidStatement "-- " 90syntax match mermaidStatement "\%(<|\| [ <*o ] \)\?\%(--\|\.\.\)\%(|>\| [ >*o ] \)\? " 91syntax match mermaidStatement "-\{2,4} [ >ox- ] " 92syntax match mermaidStatement "\.- [ >ox ] " 93syntax match mermaidStatement "-\. " 94syntax match mermaidStatement "-\.\{1,3}- " 95syntax match mermaidStatement "== " 96syntax match mermaidStatement "=\{2,4} [ >ox= ] " 97syntax match mermaidStatement "& " 98syntax match mermaidStatement "--\? [ >x) ] >\? [ +- ] \? " 99syntax match mermaidStatement "x--x " 100syntax match mermaidStatement "o--o\? " 101syntax match mermaidStatement "<-->\? " 102syntax match mermaidStatement "::: " 103syntax match mermaidStatement "||--o{ " 104highlight link mermaidStatement Statement 105 106" FIXME: This unexpectedly matches flow chart node `id1(text)` or others. 107"syntax match mermaidIdentifier "[\+-]\?\w\+(.*)[\$\*]\?" 108"highlight link mermaidIdentifier Identifier 109 110syntax match mermaidType "[ \+-\#\~ ] \?\c\%(const\s\+\|\*\s * \) * \%(unsigned\s\+\)\?\%(int\|u\?int\%(8\|16\|32\|64\)_t\|char\|long\|long\s\+long\)\>\%(\s\+const\|\s * [ \*& ] \) * " 111syntax match mermaidType "[ \+-\#\~ ] \?\c\%(const\s\+\|\*\s * \) * \%(double\|float\|String\|bool\)\>\%(\s\+const\|\s * [ \*& ] \) * " 112syntax match mermaidType "[ \+-\#\~ ] \?\cBigDecimal\> " 113syntax match mermaidType "[ \+-\#\~ ] \?\cList\~.\+\~ " 114syntax match mermaidType "<<\w\+>> " 115highlight link mermaidType Type 116 117syntax match mermaidComment "%%. * $ " 118highlight link mermaidComment Comment 119 120syntax region mermaidDirective start = "%%{ "end = "\}%% " 121highlight link mermaidDirective PreProc 122 123syntax region mermaidString start = /" /skip = /\\" /end = /" / 124highlight link mermaidString String 125 126let b: current_syntax = "mermaid" 127 128let & cpo = s: cpo_save 129unlet s: cpo_save 130 131" vim:set sw=2: