From b487a11ad00bdd77a721d7b6ef08adbe3fb2726b Mon Sep 17 00:00:00 2001 From: Roshan Rao Date: Sun, 30 Sep 2018 16:46:51 -0700 Subject: [PATCH 1/2] add python function calls and built in errors --- syntax/python.vim | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/syntax/python.vim b/syntax/python.vim index 913da9d..25deaee 100644 --- a/syntax/python.vim +++ b/syntax/python.vim @@ -88,6 +88,7 @@ if s:Python2Syntax() else syn keyword pythonStatement as nonlocal syn match pythonStatement '\v\.@' + syn match pythonFunctionCall '\v([^[:cntrl:][:space:][:punct:][:digit:]]|_)([^[:cntrl:][:punct:][:space:]]|_)*\ze(\s?\()' display syn match pythonFunction '\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*' display contained syn match pythonStatement '\' nextgroup=pythonFunction skipwhite syn match pythonStatement '\' @@ -385,6 +386,27 @@ if s:Enabled('g:python_highlight_exceptions') unlet s:exs_re endif +" Builtin exceptions and warnings +syn keyword pythonExClass BaseException +syn keyword pythonExClass Exception StandardError ArithmeticError +syn keyword pythonExClass LookupError EnvironmentError +syn keyword pythonExClass AssertionError AttributeError BufferError EOFError +syn keyword pythonExClass FloatingPointError GeneratorExit IOError +syn keyword pythonExClass ImportError IndexError KeyError +syn keyword pythonExClass KeyboardInterrupt MemoryError NameError +syn keyword pythonExClass NotImplementedError OSError OverflowError +syn keyword pythonExClass ReferenceError RuntimeError StopIteration +syn keyword pythonExClass SyntaxError IndentationError TabError +syn keyword pythonExClass SystemError SystemExit TypeError +syn keyword pythonExClass UnboundLocalError UnicodeError +syn keyword pythonExClass UnicodeEncodeError UnicodeDecodeError +syn keyword pythonExClass UnicodeTranslateError ValueError VMSError +syn keyword pythonExClass WindowsError ZeroDivisionError +syn keyword pythonExClass Warning UserWarning BytesWarning DeprecationWarning +syn keyword pythonExClass PendingDepricationWarning SyntaxWarning +syn keyword pythonExClass RuntimeWarning FutureWarning +syn keyword pythonExClass ImportWarning UnicodeWarning + if s:Enabled('g:python_slow_sync') syn sync minlines=2000 else @@ -407,10 +429,12 @@ if v:version >= 508 || !exists('did_python_syn_inits') HiLink pythonRaiseFromStatement Statement HiLink pythonImport Include HiLink pythonFunction Function + HiLink pythonFunctionCall Identifier HiLink pythonConditional Conditional HiLink pythonRepeat Repeat HiLink pythonException Exception HiLink pythonOperator Operator + HiLink pythonExClass Special HiLink pythonDecorator Define HiLink pythonDottedName Function From 2dab170b2cebdb921ff4e4f9bb6081f9f37610ce Mon Sep 17 00:00:00 2001 From: Roshan Rao Date: Mon, 1 Oct 2018 13:56:35 -0700 Subject: [PATCH 2/2] change pythonClassVar color --- syntax/python.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/python.vim b/syntax/python.vim index 25deaee..d2741af 100644 --- a/syntax/python.vim +++ b/syntax/python.vim @@ -499,7 +499,7 @@ if v:version >= 508 || !exists('did_python_syn_inits') HiLink pythonBuiltinFunc Function HiLink pythonExClass Structure - HiLink pythonClassVar Identifier + HiLink pythonClassVar Special delcommand HiLink endif