From 44d1bf26705bb272fb86ff1b0bdb542bda6e8242 Mon Sep 17 00:00:00 2001 From: Kaiwen Li Date: Wed, 14 Feb 2018 18:40:54 -0500 Subject: Add ocaml.vim --- ligature_plugins/ocaml.vim | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 ligature_plugins/ocaml.vim diff --git a/ligature_plugins/ocaml.vim b/ligature_plugins/ocaml.vim new file mode 100644 index 0000000..fef4557 --- /dev/null +++ b/ligature_plugins/ocaml.vim @@ -0,0 +1,36 @@ +" fork of https://gist.github.com/NicolasT/1043747 + +" set correct conceal +setlocal conceallevel=1 + +" we need the conceal feature (vim ≥ 7.3) +if exists('g:no_ocaml_conceal') || !has('conceal') + finish +endif + +" fun +syntax keyword ocamlNiceKeyword fun conceal cchar=λ + +" -> +syntax match ocamlArrow /->/ contains=ocamlArrowM,ocamlArrowH +syntax match ocamlArrowM /-/ contained containedin=ocamlArrow conceal cchar= +syntax match ocamlArrowH /-\@<=>/ contained containedin=ocamlArrow conceal cchar=→ + +" <- +syntax match ocamlArrow /<\ze-/ contains=ocamlArrowM,ocamlArrowH +syntax match ocamlArrowH / +syntax match ocamlArrow /=>/ contains=ocamlArrowM,ocamlArrowH +syntax match ocamlArrowM /=/ contained containedin=ocamlArrow conceal cchar= +syntax match ocamlArrowH /=\@<=>/ contained containedin=ocamlArrow conceal cchar=⇒ + +" <> +syntax match ocamlNiceOperator "<>" conceal cchar=≠ + +" greek letters +syntax match ocamlNiceTypes "'a" conceal cchar=α +syntax match ocamlNiceTypes "'b" conceal cchar=β +syntax match ocamlNiceTypes "'c" conceal cchar=γ +syntax match ocamlNiceTypes "'d" conceal cchar=δ +syntax match ocamlNiceTypes "'e" conceal cchar=ε -- cgit v1.2.3 From 5d7fa8386681b0c04251339efd9276be77bfa852 Mon Sep 17 00:00:00 2001 From: Kaiwen Li Date: Wed, 14 Feb 2018 18:42:19 -0500 Subject: Update ocaml.vim --- ligature_plugins/ocaml.vim | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ligature_plugins/ocaml.vim b/ligature_plugins/ocaml.vim index fef4557..14c78e5 100644 --- a/ligature_plugins/ocaml.vim +++ b/ligature_plugins/ocaml.vim @@ -20,11 +20,6 @@ syntax match ocamlArrowH /-\@<=>/ contained containedin=ocamlArrow conceal cc syntax match ocamlArrow /<\ze-/ contains=ocamlArrowM,ocamlArrowH syntax match ocamlArrowH / -syntax match ocamlArrow /=>/ contains=ocamlArrowM,ocamlArrowH -syntax match ocamlArrowM /=/ contained containedin=ocamlArrow conceal cchar= -syntax match ocamlArrowH /=\@<=>/ contained containedin=ocamlArrow conceal cchar=⇒ - " <> syntax match ocamlNiceOperator "<>" conceal cchar=≠ -- cgit v1.2.3