From 1d5ed6b309a45dcc93d69058a3a5b8990b4a5349 Mon Sep 17 00:00:00 2001 From: tcpj Date: Sun, 10 Dec 2017 18:29:54 +0100 Subject: [PATCH] feat: self, cls, None better highlighting --- syntax/python.vim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/syntax/python.vim b/syntax/python.vim index e963628..f9b26d1 100644 --- a/syntax/python.vim +++ b/syntax/python.vim @@ -176,7 +176,7 @@ if s:Python2Syntax() syn keyword pythonImport as syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" display contained else - syn keyword pythonStatement as nonlocal None + syn keyword pythonStatement as nonlocal syn match pythonStatement "\" display syn keyword pythonBoolean True False syn match pythonFunction "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained @@ -186,6 +186,10 @@ else syn match pythonStatement "\" display endif +" self, None highlight +syn keyword pythonSelf self cls +syn keyword pythonNone None + " " Decorators (new in Python 2.4) " @@ -399,7 +403,6 @@ syn match pythonFloat "\<\d\+\.\d*\%([eE][+-]\=\d\+\)\=[jJ]\=" display if s:Enabled("g:python_highlight_builtin_objs") if s:Python2Syntax() - syn keyword pythonBuiltinObj None syn keyword pythonBoolean True False endif syn keyword pythonBuiltinObj Ellipsis NotImplemented @@ -561,6 +564,8 @@ if version >= 508 || !exists("did_python_syn_inits") HiLink pythonBuiltinFunc Function HiLink pythonExClass Structure + HiLink pythonSelf Identifier + HiLink pythonNone Boolean delcommand HiLink endif