The equal sign in vim is not highlighted

  question, vim

Win32, gvim, version 7.4, python highlight. How to highlight the equal sign, code highlight is no problem, just like the equal sign it does not highlight, should not be a color theme problem.

Thank you for your answer, your method can be highlighted.
I don’t know what’s going on. I can’t change the. vim file. entering those commands in the window is only effective.
Finally, it was clear that what I modified was the python.vim highlight file under the vim installation directory.
While I installed bundle and python-syntax, the default load is python.vim under python-syntax.
Therefore, the modification is invalid.

The landlord can try this scheme and write his own grammar highlighting rules:

  1. Add under. vim foldersyntax/python.vimFile
  2. Add the following to the file:
syntax match pythonOperator "\v\="
 syntax match pythonOperator "\v\*\="
 syntax match pythonOperator "\v/\="
 syntax match pythonOperator "\v\+\="
 syntax match pythonOperator "\v-\="
 syntax match pythonOperator "\v\%\="
 syntax match pythonOperator "\v\&\="
 syntax match pythonOperator "\v\|\="
 syntax match pythonOperator "\v\!  \="
 syntax match pythonOperator "\v\>\="
 syntax match pythonOperator "\v\<\="
 syntax match pythonOperator "\v\=\="
 syntax match pythonOperator "\v//\="
 syntax match pythonOperator "\v\^\="
 syntax match pythonOperator "\v\>\>\="
 syntax match pythonOperator "\v\<\<\="
 syntax match pythonOperator "\v\*\*\="
 
 highlight link pythonOperator SpecialChar

Explanation:
Syntax match creates a grammar group calledpythonOperator
Andhighlight link pythonOperator SpecialCharLet this grammar group match the content withSpecialCharHighlight type.
SpecialCharWhat does highlight type mean? Open your color scheme (usually in.vim/bundleYou can see that the author has set different colors for different highlight types.SpecialCharIs one of them.

  1. Open this test file:test.py, and see if it is effective
a = 1
 b = 2
 a += b
 a -= b
 a *= b
 a /= b
 a %= b
 a **= b
 a == b
 a >= b
 a <= b
 a !  = b
 a >>= b
 a <<= b
 a &= b
 a |= b
 a //= b