From 32c7868195c9674ccc5a4cf204d22ae3c2ce5274 Mon Sep 17 00:00:00 2001 From: Dmitry Vasiliev Date: Fri, 9 Apr 2010 22:14:20 +0400 Subject: [PATCH] Added options python_highlight_builtin_objs and python_highlight_builtin_funcs --- CHANGES.txt | 5 +++++ python.vim | 30 +++++++++++++++++++++++------- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 8bacd7d..41d35dd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -20,6 +20,11 @@ Revision 3.0.0 (2008-12-07): "execfile", "file", "help", "intern", "long", "raw_input", "reduce", "reload", "unichr", "unicode", "xrange"; +Revision 2.6.6 (2010-04-09): + + - Applied patch by Andrea Riciputi with new configuration options + "python_highlight_builtin_objs" and "python_highligh_builtin_funcs" + Revision 2.6.5 (2009-07-24): - Applied patch by Caleb Adamantine which fixes highlighting for decorators diff --git a/python.vim b/python.vim index 04cf875..0e0bb12 100644 --- a/python.vim +++ b/python.vim @@ -2,9 +2,9 @@ " Language: Python " Maintainer: Dmitry Vasiliev " URL: http://www.hlabs.spb.ru/vim/python.vim -" Last Change: 2009-07-24 +" Last Change: 2010-04-09 " Filenames: *.py -" Version: 2.6.5 +" Version: 2.6.6 " " Based on python.vim (from Vim 6.1 distribution) " by Neil Schemenauer @@ -20,6 +20,8 @@ " 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: @@ -29,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 " @@ -74,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 @@ -230,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