From a92327ffc53908db8a4ac9307c98abb32125715f Mon Sep 17 00:00:00 2001 From: Matt Smith Date: Tue, 26 Jan 2016 14:31:15 -0800 Subject: [PATCH] Adding self/class and member variable highligting --- syntax/python.vim | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/syntax/python.vim b/syntax/python.vim index e963628..31555d1 100644 --- a/syntax/python.vim +++ b/syntax/python.vim @@ -487,6 +487,16 @@ else syn sync maxlines=200 endif +" Self/Cls and Member Variables +syn match pythonThis /\v(self|cls)/ contained +syn match pythonThis /\v(self|cls)/ +syn match pythonDunder "__\w\+__" +syn match pythonMember /\vself\.\w+(\w|\()@!/hs=s+5 contains=pythonThis +syn match pythonMember /\vcls\.\w+(\w|\()@!/hs=s+4 contains=pythonThis +hi link pythonThis Keyword +hi link pythonDunder Define +hi link pythonMember Type + if version >= 508 || !exists("did_python_syn_inits") if version <= 508 let did_python_syn_inits = 1