aboutsummaryrefslogtreecommitdiffhomepage
path: root/editors/vim/syntax/bruijn.vim
blob: 9fdf7aee125d7632138d50e84e16ff385b8c31cd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
" Vim syntax file
" Language: Bruijn

if exists("b:current_syntax")
  finish
endif

syn match bruijnApplication /[()]/
syn match bruijnAbstraction /[[\]]/
syn match bruijnIndex /\([^0-9]\)\@<=\d\([^0-9]\)\@=/
syn match bruijnNumber /([+-]\d\+)/
syn match bruijnDefinition /^\t*\S\+/
syn match bruijnKeyword /:test\|:import\|:input/
syn match bruijnNamespace /[A-Z][a-z]*\(\.\)\@=/
syn match bruijnNamespaceDelim /\([A-Z][a-z]*\)\@<=\./

syn region bruijnCommentLine start="^# " end="$" oneline
syn region bruijnString start=+"+ end=+"+ oneline
syn region bruijnChar start=+'+ end=+'+ oneline

hi def link bruijnIndex Special
hi def link bruijnNumber Number
hi def link bruijnString String
hi def link bruijnChar String
hi def link bruijnDefinition Define
hi def link bruijnKeyword Macro
hi def link bruijnNamespace Type
hi def link bruijnNamespaceDelim Special
hi def link bruijnAbstraction Function
hi def link bruijnApplication Statement
hi def link bruijnCommentLine Comment

let b:current_syntax = "bruijn"

" complete using space or C-]
abbreviate > ‣
abbreviate ? …
abbreviate && ⋀
abbreviate \|\| ⋁
abbreviate sum ∑
abbreviate prod ∏
abbreviate rprod ∐
abbreviate infty ∞
abbreviate . ∘
abbreviate * ⋅
abbreviate ** ⋆
abbreviate => ⇒
abbreviate <=> ⇔
abbreviate -> →
abbreviate <-> ↔
abbreviate -^ ↑
abbreviate :: ∷
abbreviate bra ⟨
abbreviate ket ⟩
abbreviate bbra ⟪
abbreviate kket ⟫
abbreviate <=? ≤
abbreviate >=? ≥
abbreviate ! ¬
abbreviate _0 ₀
abbreviate _1 ₁
abbreviate _2 ₂
abbreviate _3 ₃
abbreviate _4 ₄
abbreviate _5 ₅
abbreviate _6 ₆
abbreviate _7 ₇
abbreviate _8 ₈
abbreviate _9 ₉
abbreviate _+ ₊
abbreviate _- ₋
abbreviate _= ₌
abbreviate _( ₍
abbreviate _) ₎
abbreviate ^0 ⁰
abbreviate ^1 ¹
abbreviate ^2 ²
abbreviate ^3 ³
abbreviate ^4 ⁴
abbreviate ^5 ⁵
abbreviate ^6 ⁶
abbreviate ^7 ⁷
abbreviate ^8 ⁸
abbreviate ^9 ⁹
abbreviate ^\+ ⁺
abbreviate ^- ⁻
abbreviate ^= ⁼
abbreviate ^\( ⁽
abbreviate ^\) ⁾

" === Greek letters === 
abbreviate Alpha Α
abbreviate alpha α
abbreviate Beta Β
abbreviate beta β
abbreviate Gamma Γ
abbreviate gamma γ
abbreviate Delta Δ
abbreviate delta δ
abbreviate Epsilon Ε
abbreviate epsilon ε
abbreviate varepsilon ϵ
abbreviate Zeta Ζ
abbreviate zeta ζ
abbreviate Eta Η
abbreviate eta η
abbreviate Theta Θ
abbreviate theta θ
abbreviate Iota Ι
abbreviate iota ι
abbreviate Kappa Κ
abbreviate kappa κ
abbreviate Lambda Λ
abbreviate lambda λ
abbreviate Mu Μ
abbreviate mu μ
abbreviate Nu Ν
abbreviate nu ν
abbreviate Xi Ξ
abbreviate xi ξ
abbreviate Omicron Ο
abbreviate omicron ο
abbreviate Pi Π
abbreviate pi π
abbreviate Rho Ρ
abbreviate rho ρ
abbreviate Sigma Σ
abbreviate sigma σ
abbreviate Tau Τ
abbreviate tau τ
abbreviate Upsilon Υ
abbreviate upsilon υ
abbreviate Phi Φ
abbreviate phi φ
abbreviate varphi ϕ
abbreviate Chi Χ
abbreviate chi χ
abbreviate Psi Ψ
abbreviate psi ψ
abbreviate Omega Ω
abbreviate omega ω