aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ligature_plugins/README.md33
-rw-r--r--ligature_plugins/haskell.vim2
-rw-r--r--ligature_plugins/python.vim37
3 files changed, 71 insertions, 1 deletions
diff --git a/ligature_plugins/README.md b/ligature_plugins/README.md
new file mode 100644
index 0000000..a17c67b
--- /dev/null
+++ b/ligature_plugins/README.md
@@ -0,0 +1,33 @@
1# Ligatures and Unicode substitution
2
3These features are supported *in vim only*.
4
5### Installation
6
7Symlink the required vim plugins to
8
9 - `~/.vim/after/syntax/` (vim)
10 - `~/.config/nvim/after/syntax/` (neovim)
11
12 ```shell
13 #vim
14 cd ~/scientifica/ligature_plugins/
15 for i in `ls *.vim`; do
16 ln -sf ~/scientifica/ligature_plugins/"$i" ~/.vim/after/syntax/"$i"
17 done
18
19 #nvim
20 cd ~/scientifica/ligature_plugins/
21 for i in `ls *.vim`; do
22 ln -sf ~/scientifica/ligature_plugins/"$i" ~/.config/nvim/after/syntax/"$i"
23 done
24 ```
25
26Haskell in vim with scientifica:
27![haskell_ligs](https://0x0.st/sT8a.png)
28
29Credits go to [romeovs](https://github.com/romeovs/) for the haskell plugin.
30Credits go to [ehamberg](https://github.com/ehamberg/vim-cute-python) for the python plugin.
31
32Both plugins have been modified (haskell.vim especially) to play well with scientifica.
33If you need ligatures for other languages, just open an issue, with the language and the ligature sequence.
diff --git a/ligature_plugins/haskell.vim b/ligature_plugins/haskell.vim
index b556b0a..e582dc7 100644
--- a/ligature_plugins/haskell.vim
+++ b/ligature_plugins/haskell.vim
@@ -3,7 +3,7 @@
3 3
4 4
5" set correct conceal 5" set correct conceal
6set conceallevel=1 6setlocal conceallevel=1
7 7
8" lambda's 8" lambda's
9syntax match hsLambda "\\" conceal cchar=λ 9syntax match hsLambda "\\" conceal cchar=λ
diff --git a/ligature_plugins/python.vim b/ligature_plugins/python.vim
new file mode 100644
index 0000000..3542ae3
--- /dev/null
+++ b/ligature_plugins/python.vim
@@ -0,0 +1,37 @@
1" This is a fork of vim-cute-python
2" with a few character replacements to
3" play well with scientifica
4
5" we need the conceal feature (vim ≥ 7.3)
6if !has('conceal')
7 finish
8endif
9
10" remove the keywords. we'll re-add them below
11syntax clear pythonOperator
12
13syntax match pythonOperator "\<is\>"
14
15syntax match pyNiceOperator "\<in\>" conceal cchar=∈
16syntax match pyNiceOperator "\<or\>" conceal cchar=∨
17syntax match pyNiceOperator "\<and\>" conceal cchar=∧
18" include the space after “not” – if present – so that “not a” becomes “¬a”.
19" also, don't hide “not” behind ‘¬’ if it is after “is ”.
20syntax match pyNiceOperator "<=" conceal cchar=≤
21syntax match pyNiceOperator ">=" conceal cchar=≥
22" only conceal “==” if alone, to avoid concealing SCM conflict markers
23syntax match pyNiceOperator "=\@<!===\@!" conceal cchar=≡
24syntax match pyNiceOperator "!=" conceal cchar=≠
25
26syntax keyword pyNiceOperator sum conceal cchar=∑
27syntax match pyNiceOperator "\<\%(math\.\)\?sqrt\>" conceal cchar=√
28syntax match pyNiceKeyword "\<\%(math\.\)\?pi\>" conceal cchar=π
29
30syntax keyword pyNiceStatement lambda conceal cchar=λ
31
32hi link pyNiceOperator Operator
33hi link pyNiceStatement Statement
34hi link pyNiceKeyword Keyword
35hi! link Conceal Operator
36
37setlocal conceallevel=1