From d7021362528559dc94aaffa96efb69be56bd4f8c Mon Sep 17 00:00:00 2001 From: Dmitry Vasiliev Date: Fri, 9 Apr 2010 22:18:47 +0400 Subject: [PATCH] Added options python_highlight_builtin_objs and python_highlight_builtin_funcs --- CHANGES.txt | 5 +++++ python3.0.vim | 28 ++++++++++++++++++++++------ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 41d35dd..ff49860 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,8 @@ +Revision 3.0.3 (2010-04-09): + + - Applied patch by Andrea Riciputi with new configuration options + "python_highlight_builtin_objs" and "python_highligh_builtin_funcs" + Revision 3.0.2 (2009-07-24): - Applied patch by Caleb Adamantine which fixes highlighting for decorators diff --git a/python3.0.vim b/python3.0.vim index b8a7726..adc85aa 100644 --- a/python3.0.vim +++ b/python3.0.vim @@ -2,9 +2,9 @@ " Language: Python " Maintainer: Dmitry Vasiliev " URL: http://www.hlabs.spb.ru/vim/python3.0.vim -" Last Change: 2009-07-24 +" Last Change: 2010-04-09 " Filenames: *.py -" Version: 3.0.2 +" Version: 3.0.3 " " 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: @@ -32,6 +34,12 @@ " For highlight builtin functions: " 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 " @@ -71,7 +79,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 @@ -227,17 +240,20 @@ syn match pythonFloat "\<\d\+\.\d*\%([eE][+-]\=\d\+\)\=[jJ]\=" display syn match pythonOctError "\<0[oO]\=\o*[8-9]\d*\>" display syn match pythonBinError "\<0[bB][01]*[2-9]\d*\>" 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 Ellipsis 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 ascii syn keyword pythonBuiltinFunc bin bool bytearray bytes syn keyword pythonBuiltinFunc chr classmethod cmp compile complex syn keyword pythonBuiltinFunc delattr dict dir divmod enumerate eval syn keyword pythonBuiltinFunc exec filter float format frozenset getattr - syn keyword pythonBuiltinFunc globals hasattr hash hex id + syn keyword pythonBuiltinFunc globals hasattr hash hex id syn keyword pythonBuiltinFunc input int isinstance syn keyword pythonBuiltinFunc issubclass iter len list locals map max syn keyword pythonBuiltinFunc memoryview min next object oct open ord