Browse Source

A bunch of operator highlights

Pedro Algarvio 9 years ago
parent
commit
f12e6e9bba
1 changed files with 29 additions and 0 deletions
  1. 29
    0
      syntax/python.vim

+ 29
- 0
syntax/python.vim View File

34
 "   let python_no_string_format_highlight = 1
34
 "   let python_no_string_format_highlight = 1
35
 "   let python_no_string_formatting_highlight = 1
35
 "   let python_no_string_formatting_highlight = 1
36
 "   let python_no_string_template_highlight = 1
36
 "   let python_no_string_template_highlight = 1
37
+"   let python_no_extra_operators_highlight = 1
38
+"   let python_no_stars_operators_highlight = 1
39
+"   let python_no_equal_sign_operator_highlight = 1
37
 "   let python_space_error_highlight = 1
40
 "   let python_space_error_highlight = 1
38
 "   let python_shebang_header_highlight = 1
41
 "   let python_shebang_header_highlight = 1
39
 "   let python_coding_header_highlight = 1
42
 "   let python_coding_header_highlight = 1
84
   if exists("python_no_string_template_highlight")
87
   if exists("python_no_string_template_highlight")
85
     unlet python_no_string_template_highlight
88
     unlet python_no_string_template_highlight
86
   endif
89
   endif
90
+  if exists("python_no_extra_operators_highlight")
91
+    unlet python_no_extra_operators_highlight
92
+  endif
93
+  if exists("python_no_stars_operators_highlight")
94
+    unlet python_no_stars_operators_highlight
95
+  endif
96
+  if exists("python_no_equal_sign_operator_highlight")
97
+    unlet python_no_equal_sign_operator_highlight
98
+  endif
87
   let python_space_error_highlight = 1
99
   let python_space_error_highlight = 1
88
   let python_shebang_header_highlight = 1
100
   let python_shebang_header_highlight = 1
89
   let python_coding_header_highlight = 1
101
   let python_coding_header_highlight = 1
123
   syn keyword pythonSelf	self cls
135
   syn keyword pythonSelf	self cls
124
 endif
136
 endif
125
 
137
 
138
+if !exists("python_no_extra_operators_highlight")
139
+  syn match pythonExtraOperator "\%([~!^&|/%+-]\|\%(class\s*\)\@<!<<\|<=>\|<=\|\%(<\|\<class\s\+\u\w*\s*\)\@<!<[^<]\@=\|===\|==\|=\~\|>>\|>=\|=\@<!>\|\.\.\.\|\.\.\|::\)"
140
+  syn match pythonExtraPseudoOperator "\%(-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!=\)"
141
+endif
142
+
143
+if !exists("python_no_stars_operators_highlight")
144
+  syn match pythonExtraOperator "\%(\*\|\*\*\)"
145
+endif
146
+
147
+if !exists("python_no_equal_sign_operator_highlight")
148
+  syn match pythonExtraOperator "\%(=\)"
149
+endif
150
+
126
 " Decorators (new in Python 2.4)
151
 " Decorators (new in Python 2.4)
127
 syn match   pythonDecorator	"@" display nextgroup=pythonFunction skipwhite
152
 syn match   pythonDecorator	"@" display nextgroup=pythonFunction skipwhite
128
 " The zero-length non-grouping match before the function name is
153
 " The zero-length non-grouping match before the function name is
319
   HiLink pythonConditional	Conditional
344
   HiLink pythonConditional	Conditional
320
   HiLink pythonRepeat		Repeat
345
   HiLink pythonRepeat		Repeat
321
   HiLink pythonOperator		Operator
346
   HiLink pythonOperator		Operator
347
+  if !exists("python_no_extra_operators_highlight")
348
+    HiLink pythonExtraOperator		Operator
349
+    HiLink pythonExtraPseudoOperator	Operator
350
+  endif
322
   HiLink pythonException	Exception
351
   HiLink pythonException	Exception
323
   HiLink pythonInclude		Include
352
   HiLink pythonInclude		Include
324
   HiLink pythonDecorator	Define
353
   HiLink pythonDecorator	Define