Added options python_highlight_builtin_objs and python_highlight_builtin_funcs

This commit is contained in:
Dmitry Vasiliev
2010-04-09 22:14:20 +04:00
parent 4fc6d28416
commit 32c7868195
2 changed files with 28 additions and 7 deletions

View File

@@ -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

View File

@@ -2,9 +2,9 @@
" Language: Python
" Maintainer: Dmitry Vasiliev <dima@hlabs.spb.ru>
" 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 <nas@python.ca>
@@ -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,11 +243,14 @@ 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