瀏覽代碼

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 年之前
父節點
當前提交
fc28c3c3d8
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6
    0
      syntax/python.vim

+ 6
- 0
syntax/python.vim 查看文件

@@ -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