From: Simon Ruderich Date: Sun, 15 May 2011 13:22:09 +0000 (+0200) Subject: vim/syntax/python.vim: Update to 2.6.6. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=a84760bf8b9250c5e1e9d4e6b2a0ad31918f83c4;p=config%2Fdotfiles.git vim/syntax/python.vim: Update to 2.6.6. --- diff --git a/vim/syntax/python.vim b/vim/syntax/python.vim index 3f739af..0e0bb12 100644 --- a/vim/syntax/python.vim +++ b/vim/syntax/python.vim @@ -2,9 +2,9 @@ " Language: Python " Maintainer: Dmitry Vasiliev " URL: http://www.hlabs.spb.ru/vim/python.vim -" Last Change: 2008-09-29 +" Last Change: 2010-04-09 " Filenames: *.py -" Version: 2.6.3 +" Version: 2.6.6 " " Based on python.vim (from Vim 6.1 distribution) " by Neil Schemenauer @@ -18,6 +18,10 @@ " (strings and comments) " John Eikenberry " for the patch fixing small typo +" Caleb Adamantine +" for the patch fixing highlighting for decorators +" Andrea Riciputi +" for the patch with new configuration options " " Options: @@ -27,9 +31,15 @@ " " Option names: " -" For highlight builtin functions: +" For highlight builtin functions and objects: " python_highlight_builtins " +" For highlight builtin objects: +" python_highlight_builtin_objs +" +" For highlight builtin funtions: +" python_highlight_builtin_funcs +" " For highlight standard exceptions: " python_highlight_exceptions " @@ -72,7 +82,12 @@ endif if exists("python_highlight_all") && python_highlight_all != 0 " Not override previously set options if !exists("python_highlight_builtins") - let python_highlight_builtins = 1 + if !exists("python_highlight_builtin_objs") + let python_highlight_builtin_objs = 1 + endif + if !exists("python_highlight_builtin_funcs") + let python_highlight_builtin_funcs = 1 + endif endif if !exists("python_highlight_exceptions") let python_highlight_exceptions = 1 @@ -108,7 +123,7 @@ syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" display contained syn keyword pythonRepeat for while syn keyword pythonConditional if elif else -syn keyword pythonImport import from as +syn keyword pythonPreCondit import from as syn keyword pythonException try except finally syn keyword pythonOperator and in is not or @@ -117,7 +132,9 @@ if !exists("python_print_as_function") || python_print_as_function == 0 endif " Decorators (new in Python 2.4) -syn match pythonDecorator "@" display nextgroup=pythonFunction skipwhite +syn match pythonDecorator "@" display nextgroup=pythonDottedName skipwhite +syn match pythonDottedName "[a-zA-Z_][a-zA-Z0-9_]*\(\.[a-zA-Z_][a-zA-Z0-9_]*\)*" display contained +syn match pythonDot "\." display containedin=pythonDottedName " Comments syn match pythonComment "#.*$" display contains=pythonTodo,@Spell @@ -226,17 +243,20 @@ syn match pythonFloat "\<\d\+\.\d*\([eE][+-]\=\d\+\)\=[jJ]\=" display syn match pythonOctError "\<0[oO]\=\o*[8-9]\d*[lL]\=\>" display syn match pythonBinError "\<0[bB][01]*[2-9]\d*[lL]\=\>" display -if exists("python_highlight_builtins") && python_highlight_builtins != 0 - " Builtin functions, types and objects +if exists("python_highlight_builtin_objs") && python_highlight_builtin_objs != 0 + " Builtin objects and types syn keyword pythonBuiltinObj True False Ellipsis None NotImplemented syn keyword pythonBuiltinObj __debug__ __doc__ __file__ __name__ __package__ +endif +if exists("python_highlight_builtin_funcs") && python_highlight_builtin_funcs != 0 + " Builtin functions syn keyword pythonBuiltinFunc __import__ abs all any apply syn keyword pythonBuiltinFunc basestring bin bool buffer bytearray bytes callable syn keyword pythonBuiltinFunc chr classmethod cmp coerce compile complex syn keyword pythonBuiltinFunc delattr dict dir divmod enumerate eval syn keyword pythonBuiltinFunc execfile file filter float format frozenset getattr - syn keyword pythonBuiltinFunc globals hasattr hash help hex id + syn keyword pythonBuiltinFunc globals hasattr hash help hex id syn keyword pythonBuiltinFunc input int intern isinstance syn keyword pythonBuiltinFunc issubclass iter len list locals long map max syn keyword pythonBuiltinFunc min next object oct open ord @@ -295,7 +315,7 @@ if version >= 508 || !exists("did_python_syn_inits") endif HiLink pythonStatement Statement - HiLink pythonImport Statement + HiLink pythonPreCondit Statement HiLink pythonFunction Function HiLink pythonConditional Conditional HiLink pythonRepeat Repeat @@ -303,6 +323,8 @@ if version >= 508 || !exists("did_python_syn_inits") HiLink pythonOperator Operator HiLink pythonDecorator Define + HiLink pythonDottedName Function + HiLink pythonDot Normal HiLink pythonComment Comment HiLink pythonCoding Special