all repos — dotfiles @ 2d5fa70da78d05147a4055c51c983b93a4bc32dd

personal dotfiles

.config/nvim/syntax/pikchr.vim (view raw)

 1" Vim syntax file
 2" Language: Pikchr
 3" Mantainer: la-ninpre
 4" Latest Revision: 14 Dec 2020
 5
 6" check if syntax highlighting is not in conflict
 7if exists("b:current_syntax")
 8    finish
 9endif
10
11""" syntax block
12
13" keywords
14syntax keyword PikchrStatement print assert
15syntax keyword PikchrExprFunc abs cos dist int max min sin sqrt
16syntax keyword PikchrObject arc arrow box circle cylinder dot ellipse file line
17syntax keyword PikchrObject move oval spline text
18syntax keyword PikchrDirection right down left up nextgroup=PikchrNumber
19syntax keyword PikchrDirection n north ne e east se s south sw w west nw
20syntax keyword PikchrPlace of in vertex
21syntax keyword PikchrAttribute dashed dotted color fill behind cw ccw
22syntax keyword PikchrAttribute thick thin solid chop fit
23syntax keyword PikchrTextAttr above aligned below big small bold italic
24syntax keyword PikchrTextAttr center ljust rjust
25syntax keyword PikchrLocAttr at with
26syntax keyword PikchrEdgename n north ne nw e east s south se sw w west
27syntax keyword PikchrEdgename t top bot bottom c center start end left right 
28syntax keyword PikchrEdgename nextgroup=PikchrPlace
29syntax keyword PikchrNumPropty diameter ht height rad radius thickness width wid
30syntax keyword PikchrNthObj last previous
31syntax keyword PikchrOperator + - * /
32
33" define stmt
34syntax match PikchrDefineStmt "^define\s\i\+" contains=PikchrCustomObject
35syntax keyword PikchrDefine define contained
36syntax match PikchrCustomObject "\i\+" contained
37
38" literals
39syntax match PikchrComment "\v(#.*$)|(/\*.*\*/)"
40syntax match PikchrString "\".*\""
41syntax match PikchrVariable "\v\i+\s?(\*|\+|-|/)?\="
42syntax match PikchrDollVar "\$\i\+"
43syntax match PikchrLabel "\u\w*"
44syntax match PikchrNumber "\v\.?\d+(\.\d+)?(\%|in|cm|px|pt|pc|mm)?"
45syntax match PikchrNumber "\v0x\x+"
46syntax match PikchrOrdinal "\v([^0]\d+(st|nd|rd|th))|first"
47
48" matches
49syntax match PikchrAttributeSup "\v<same(\sas)?>"
50syntax match PikchrAttributeSup "\v<invis(ible)?>"
51syntax match PikchrAttributeSup "\v\<-\>?|-\>"
52syntax match PikchrPosition "\v(((of\sthe\s)?\sway\s)?between)|and"
53syntax match PikchrDotEdgename "\v\.(n(e|w)?(orth)?|e(ast)?|s(e|w)?(outh)?|w(est)?)"
54syntax match PikchrDotEdgename "\v\.(bot(tom)?|t(op)?|right|left|start|end|c(enter)?)"
55syntax match PikchrDotPropty "\v\.(color|dashed|diameter|dotted|fill)"
56syntax match PikchrDotPropty "\v\.(ht|height|rad(ius)?|thickness|wid(th)?)"
57syntax match PikchrPathElem "\v<(from|then|go|to|(until\s)?even\swith|heading|close)>" nextgroup=PikchrDirection
58
59""" highlight block
60
61" keywords
62hi def link PikchrStatement Statement
63hi def link PikchrExprFunc Function
64hi def link PikchrObject Type 
65hi def link PikchrDirection Function
66hi def link PikchrLocAttr Tag
67hi def link PikchrPlace Function
68hi def link PikchrTextAttr Identifier
69hi def link PikchrNumPropty Identifier
70hi def link PikchrEdgename Identifier
71hi def link PikchrNthObj Constant
72hi def link PikchrOperator Operator
73
74" define stmt
75hi def link PikchrDefine Define
76hi def link PikchrCustomObject Type 
77
78" literals
79hi def link PikchrComment Comment
80hi def link PikchrString String
81hi def link PikchrVariable Identifier
82hi def link PikchrDollVar Identifier
83hi def link PikchrLabel Identifier
84hi def link PikchrNumber Number
85hi def link PikchrOrdinal Number
86
87" matches
88hi def link PikchrAttribute Tag
89hi def link PikchrAttributeSup Tag
90hi def link PikchrPosition Function
91hi def link PikchrDotEdgename Identifier
92hi def link PikchrDotPropty Identifier
93hi def link PikchrPathElem Statement