diff options
-rw-r--r-- | ligature_plugins/cpp.vim | 25 | ||||
-rw-r--r-- | ligature_plugins/haskell.vim | 77 |
2 files changed, 102 insertions, 0 deletions
diff --git a/ligature_plugins/cpp.vim b/ligature_plugins/cpp.vim new file mode 100644 index 0000000..a0b7c96 --- /dev/null +++ b/ligature_plugins/cpp.vim | |||
@@ -0,0 +1,25 @@ | |||
1 | syntax clear cppOperator | ||
2 | |||
3 | |||
4 | syntax match cppBelleOperator "<=" conceal cchar=≤ | ||
5 | syntax match cppBelleOperator ">=" conceal cchar=≥ | ||
6 | syntax match cppBelleOperator "!=" conceal cchar=≠ | ||
7 | |||
8 | |||
9 | " -> | ||
10 | syn match cppPointer /->/ contains=PointerTail,PointerHead | ||
11 | syn match PointerTail /-/ contained containedin=cppPointer conceal cchar= | ||
12 | syn match PointerHead /-\@<=>/ contained containedin=cppPointer conceal cchar=→ | ||
13 | |||
14 | " == | ||
15 | syn match cppIsEqual /==/ contains=FirstEqual,SecondEqual | ||
16 | syn match FirstEqual /=/ contained containedin=cppIsEqual conceal cchar= | ||
17 | syn match SecondEqual /=\@<=>/ contained containedin=cppIsEqual conceal cchar= | ||
18 | |||
19 | |||
20 | hi link cppBelleOperator Operator | ||
21 | hi link cppPointer Keyword | ||
22 | |||
23 | |||
24 | hi! link Conceal Operator | ||
25 | setlocal conceallevel=1 | ||
diff --git a/ligature_plugins/haskell.vim b/ligature_plugins/haskell.vim new file mode 100644 index 0000000..b556b0a --- /dev/null +++ b/ligature_plugins/haskell.vim | |||
@@ -0,0 +1,77 @@ | |||
1 | " 5px wide equals | ||
2 | " 5px wide minus | ||
3 | |||
4 | |||
5 | " set correct conceal | ||
6 | set conceallevel=1 | ||
7 | |||
8 | " lambda's | ||
9 | syntax match hsLambda "\\" conceal cchar=λ | ||
10 | |||
11 | " function composition | ||
12 | syntax match hsCompose / \. /ms=s+1,me=e-1 conceal cchar=· | ||
13 | |||
14 | " -> | ||
15 | syn match MHArrow /->/ contains=MHArrowM,MHArrowH | ||
16 | syn match MHArrowM /-/ contained containedin=MHArrow conceal cchar= | ||
17 | syn match MHArrowH /-\@<=>/ contained containedin=MHArrow conceal cchar=→ | ||
18 | |||
19 | " <- | ||
20 | syn match HMArrow /<\ze-/ contains=HMArrowM,HMArrowH | ||
21 | syn match HMArrowH /</ contained containedin=HMArrow conceal cchar=← | ||
22 | |||
23 | " => | ||
24 | syn match DMHArrow /=>/ contains=DMHArrowM,DMHArrowH | ||
25 | syn match DMHArrowM /=/ contained containedin=DMHArrow conceal cchar= | ||
26 | syn match DMHArrowH /=\@<=>/ contained containedin=DMHArrow conceal cchar=⇒ | ||
27 | |||
28 | " >>= | ||
29 | syn match DTTMArrow />>\ze=/ contains=DTTMArrowT,DTTMArrowTT | ||
30 | syn match DTTMArrowTT />/ contained containedin=DTTMArrow conceal cchar= | ||
31 | syn match DTTMArrowT />\@<=>/ contained containedin=DTTMArrow conceal cchar= | ||
32 | |||
33 | " >=> | ||
34 | syn match DTMHArrow />=>/ contains=DTMHArrowT,DTMHArrowM,DTMHArrowH | ||
35 | syn match DTMHArrowT />/ contained containedin=DTMHArrow conceal cchar= | ||
36 | syn match DTMHArrowM /=/ contained containedin=DTMHArrow conceal cchar= | ||
37 | syn match DTMHArrowH /=\@<=>/ contained containedin=DTMHArrow conceal cchar=⇒ | ||
38 | |||
39 | " <=< | ||
40 | syn match DHMTArrow /<=</ contains=DHMTArrowM,DHMTArrowH,DHMTArrowT | ||
41 | syn match DHMTArrowH /</ contained containedin=DHMTArrow conceal cchar=⇐ | ||
42 | syn match DHMTArrowM /=/ contained containedin=DHMTArrow conceal cchar= | ||
43 | syn match DHMTArrowT /=\@<=</ contained containedin=DHMTArrow conceal cchar= | ||
44 | |||
45 | " =<< | ||
46 | syn match DMTTArrow /=<</ contains=DMTTArrowT,DMTTArrowTT,DMTTArrowM | ||
47 | syn match DMTTArrowM /=/ contained containedin=DMTTArrow conceal cchar= | ||
48 | syn match DMTTArrowT /</ contained containedin=DMTTArrow conceal cchar= | ||
49 | syn match DMTTArrowTT /<\@<=</ contained containedin=DMTTArrow conceal cchar=< | ||
50 | |||
51 | " -< | ||
52 | syn match MTArrow /-</ contains=MTArrowT,MTArrowM | ||
53 | syn match MTArrowT /-/ contained containedin=MTArrow conceal cchar= | ||
54 | syn match MTArrowM /-\@<=</ contained containedin=MTArrow conceal cchar=⤙ | ||
55 | |||
56 | " -<< | ||
57 | syn match MTTArrow /-<</ contains=MTTArrowT,MTTArrowM,HTTArrowTT | ||
58 | syn match MTTArrowM /-<</me=s+1 contained containedin=MTTArrow conceal cchar= | ||
59 | syn match MTTArrowT /-\@<=</ contained containedin=MTTArrow conceal cchar=⤛ | ||
60 | syn match MTTArrowTT /\(-<\)\@<=</ contained containedin=MTTArrow conceal cchar=< | ||
61 | |||
62 | " >- | ||
63 | syn match TMArrow />\ze-/ contains=TMArrowT,TMArrowM | ||
64 | syn match TMArrowT />/ contained containedin=TMArrow conceal cchar=⤚ | ||
65 | |||
66 | ">>- | ||
67 | syn match TTMArrow />>\ze-/ contains=TTMArrowT,TTMArrowTT,TTMArrowTTT | ||
68 | syn match TTMArrowTT />/ contained containedin=TTMArrow conceal cchar= | ||
69 | syn match TTMArrowT />\@<=>/ contained containedin=TTMArrow conceal cchar=⤜ | ||
70 | syn match TTMArrowTTT /-<</me=s+1 contained containedin=TTMArrow conceal cchar= | ||
71 | |||
72 | " These are probably not all arrow patterns one could come up with, so if you need | ||
73 | " another one and you can't think of how to implement it, please contact me to ask | ||
74 | " for it! I'll try to create the syntax rules. | ||
75 | |||
76 | " Also if you have come up with some more patterns please contact me so I can | ||
77 | " include them in the list. | ||