Skip to content

Commit 32c7868

Browse files
committed
Added options python_highlight_builtin_objs and python_highlight_builtin_funcs
1 parent 4fc6d28 commit 32c7868

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ Revision 3.0.0 (2008-12-07):
2020
"execfile", "file", "help", "intern", "long", "raw_input", "reduce",
2121
"reload", "unichr", "unicode", "xrange";
2222

23+
Revision 2.6.6 (2010-04-09):
24+
25+
- Applied patch by Andrea Riciputi with new configuration options
26+
"python_highlight_builtin_objs" and "python_highligh_builtin_funcs"
27+
2328
Revision 2.6.5 (2009-07-24):
2429

2530
- Applied patch by Caleb Adamantine which fixes highlighting for decorators

python.vim

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
" Language: Python
33
" Maintainer: Dmitry Vasiliev <dima@hlabs.spb.ru>
44
" URL: http://www.hlabs.spb.ru/vim/python.vim
5-
" Last Change: 2009-07-24
5+
" Last Change: 2010-04-09
66
" Filenames: *.py
7-
" Version: 2.6.5
7+
" Version: 2.6.6
88
"
99
" Based on python.vim (from Vim 6.1 distribution)
1010
" by Neil Schemenauer <nas@python.ca>
@@ -20,6 +20,8 @@
2020
" for the patch fixing small typo
2121
" Caleb Adamantine
2222
" for the patch fixing highlighting for decorators
23+
" Andrea Riciputi
24+
" for the patch with new configuration options
2325

2426
"
2527
" Options:
@@ -29,9 +31,15 @@
2931
"
3032
" Option names:
3133
"
32-
" For highlight builtin functions:
34+
" For highlight builtin functions and objects:
3335
" python_highlight_builtins
3436
"
37+
" For highlight builtin objects:
38+
" python_highlight_builtin_objs
39+
"
40+
" For highlight builtin funtions:
41+
" python_highlight_builtin_funcs
42+
"
3543
" For highlight standard exceptions:
3644
" python_highlight_exceptions
3745
"
@@ -74,7 +82,12 @@ endif
7482
if exists("python_highlight_all") && python_highlight_all != 0
7583
" Not override previously set options
7684
if !exists("python_highlight_builtins")
77-
let python_highlight_builtins = 1
85+
if !exists("python_highlight_builtin_objs")
86+
let python_highlight_builtin_objs = 1
87+
endif
88+
if !exists("python_highlight_builtin_funcs")
89+
let python_highlight_builtin_funcs = 1
90+
endif
7891
endif
7992
if !exists("python_highlight_exceptions")
8093
let python_highlight_exceptions = 1
@@ -230,17 +243,20 @@ syn match pythonFloat "\<\d\+\.\d*\([eE][+-]\=\d\+\)\=[jJ]\=" display
230243
syn match pythonOctError "\<0[oO]\=\o*[8-9]\d*[lL]\=\>" display
231244
syn match pythonBinError "\<0[bB][01]*[2-9]\d*[lL]\=\>" display
232245

233-
if exists("python_highlight_builtins") && python_highlight_builtins != 0
234-
" Builtin functions, types and objects
246+
if exists("python_highlight_builtin_objs") && python_highlight_builtin_objs != 0
247+
" Builtin objects and types
235248
syn keyword pythonBuiltinObj True False Ellipsis None NotImplemented
236249
syn keyword pythonBuiltinObj __debug__ __doc__ __file__ __name__ __package__
250+
endif
237251

252+
if exists("python_highlight_builtin_funcs") && python_highlight_builtin_funcs != 0
253+
" Builtin functions
238254
syn keyword pythonBuiltinFunc __import__ abs all any apply
239255
syn keyword pythonBuiltinFunc basestring bin bool buffer bytearray bytes callable
240256
syn keyword pythonBuiltinFunc chr classmethod cmp coerce compile complex
241257
syn keyword pythonBuiltinFunc delattr dict dir divmod enumerate eval
242258
syn keyword pythonBuiltinFunc execfile file filter float format frozenset getattr
243-
syn keyword pythonBuiltinFunc globals hasattr hash help hex id
259+
syn keyword pythonBuiltinFunc globals hasattr hash help hex id
244260
syn keyword pythonBuiltinFunc input int intern isinstance
245261
syn keyword pythonBuiltinFunc issubclass iter len list locals long map max
246262
syn keyword pythonBuiltinFunc min next object oct open ord

0 commit comments

Comments
 (0)