Created
May 2, 2011 23:17
-
-
Save andrusha/952550 to your computer and use it in GitHub Desktop.
Pretty math symbols for python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" place it in ~/.vim/after/syntax/python.vim | |
" we need the conceal feature (vim ≥ 7.3) | |
if !has('conceal') | |
finish | |
endif | |
" remove the keywords. we'll re-add them below | |
syntax clear pythonOperator | |
syntax keyword pythonOperator is | |
syntax match pyNiceOperator "\<in\>" conceal cchar=∈ | |
syntax match pyNiceOperator "\<or\>" conceal cchar=∨ | |
syntax match pyNiceOperator "\<and\>" conceal cchar=∧ | |
syntax match pyNiceOperator "\<not " conceal cchar=¬ | |
syntax match pyNiceOperator "<=" conceal cchar=≤ | |
syntax match pyNiceOperator ">=" conceal cchar=≥ | |
syntax match pyNiceOperator "==" conceal cchar=≡ | |
syntax match pyNiceOperator "!=" conceal cchar=≠ | |
syntax match pyNiceOperator "\<not in\>" conceal cchar=∉ | |
syntax keyword pyNiceStatement lambda conceal cchar=λ | |
syntax keyword pyNiceStatement int conceal cchar=ℤ | |
syntax keyword pyNiceStatement float conceal cchar=ℝ | |
syntax keyword pyNiceStatement complex conceal cchar=ℂ | |
hi link pyNiceOperator Operator | |
hi link pyNiceStatement Statement | |
hi! link Conceal Operator | |
set conceallevel=2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
very nice!
missing "for", "return", and "def" operators.
http://www.modernemacs.com/post/prettify-mode/