You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.3 KiB
VimL

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

" 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 match pythonOperator "\<is\>"
syntax match pyNiceOperator "\<in\>" conceal cchar=
syntax match pyNiceOperator "\<or\>" conceal cchar=
syntax match pyNiceOperator "\<and\>" conceal cchar=
" include the space after “not” if present so that “not a” becomes “¬a”.
" also, don't hide “not” behind ‘¬’ if it is after “is ”.
syntax match pyNiceOperator "\%(is \)\@<!\<not\%( \|\>\)" conceal cchar=¬
syntax match pyNiceOperator "\<not in\>" conceal cchar=
syntax match pyNiceOperator "<=" conceal cchar=
syntax match pyNiceOperator ">=" conceal cchar=
" only conceal “==” if alone, to avoid concealing SCM conflict markers
syntax match pyNiceOperator "=\@<!===\@!" conceal cchar=
syntax match pyNiceOperator "!=" conceal cchar=
syntax keyword pyNiceOperator sum conceal cchar=
syntax match pyNiceOperator "\<\%(math\.\)\?sqrt\>" conceal cchar=
syntax match pyNiceKeyword "\<\%(math\.\)\?pi\>" conceal cchar=π
syntax keyword pyNiceStatement lambda conceal cchar=λ
hi link pyNiceOperator Operator
hi link pyNiceStatement Statement
hi link pyNiceKeyword Keyword
hi! link Conceal Operator
setlocal conceallevel=1