aboutsummaryrefslogtreecommitdiff
path: root/ligature_plugins/python.vim
diff options
context:
space:
mode:
Diffstat (limited to 'ligature_plugins/python.vim')
-rw-r--r--ligature_plugins/python.vim37
1 files changed, 37 insertions, 0 deletions
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