Browse Source

Add pythonConvention HL class (`cls` and `self`)

These are especially useful in OOP as they help visually distinguish how
many parameters the function will be called with (in signature), or
actual state preservation from transient or return variables (in
function body).
Alois Mahdal 9 years ago
parent
commit
fc28c3c3d8
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      syntax/python.vim

+ 6
- 0
syntax/python.vim View File

@@ -477,6 +477,10 @@ if s:Enabled("g:python_highlight_exceptions")
477 477
   syn keyword pythonExClass	ImportWarning UnicodeWarning
478 478
 endif
479 479
 
480
+syn keyword pythonConvention    self
481
+syn keyword pythonConvention    cls
482
+
483
+
480 484
 if s:Enabled("g:python_slow_sync")
481 485
   syn sync minlines=2000
482 486
 else
@@ -562,6 +566,8 @@ if version >= 508 || !exists("did_python_syn_inits")
562 566
 
563 567
   HiLink pythonExClass          Structure
564 568
 
569
+  HiLink pythonConvention       Define
570
+
565 571
   delcommand HiLink
566 572
 endif
567 573