Skip to content

Commit d702136

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

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Revision 3.0.3 (2010-04-09):
2+
3+
- Applied patch by Andrea Riciputi with new configuration options
4+
"python_highlight_builtin_objs" and "python_highligh_builtin_funcs"
5+
16
Revision 3.0.2 (2009-07-24):
27

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

python3.0.vim

Lines changed: 22 additions & 6 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/python3.0.vim
5-
" Last Change: 2009-07-24
5+
" Last Change: 2010-04-09
66
" Filenames: *.py
7-
" Version: 3.0.2
7+
" Version: 3.0.3
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:
@@ -32,6 +34,12 @@
3234
" For highlight builtin functions:
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
"
@@ -71,7 +79,12 @@ endif
7179
if exists("python_highlight_all") && python_highlight_all != 0
7280
" Not override previously set options
7381
if !exists("python_highlight_builtins")
74-
let python_highlight_builtins = 1
82+
if !exists("python_highlight_builtin_objs")
83+
let python_highlight_builtin_objs = 1
84+
endif
85+
if !exists("python_highlight_builtin_funcs")
86+
let python_highlight_builtin_funcs = 1
87+
endif
7588
endif
7689
if !exists("python_highlight_exceptions")
7790
let python_highlight_exceptions = 1
@@ -227,17 +240,20 @@ syn match pythonFloat "\<\d\+\.\d*\%([eE][+-]\=\d\+\)\=[jJ]\=" display
227240
syn match pythonOctError "\<0[oO]\=\o*[8-9]\d*\>" display
228241
syn match pythonBinError "\<0[bB][01]*[2-9]\d*\>" display
229242

230-
if exists("python_highlight_builtins") && python_highlight_builtins != 0
231-
" Builtin functions, types and objects
243+
if exists("python_highlight_builtin_objs") && python_highlight_builtin_objs != 0
244+
" Builtin objects and types
232245
syn keyword pythonBuiltinObj Ellipsis NotImplemented
233246
syn keyword pythonBuiltinObj __debug__ __doc__ __file__ __name__ __package__
247+
endif
234248

249+
if exists("python_highlight_builtin_funcs") && python_highlight_builtin_funcs != 0
250+
" Builtin functions
235251
syn keyword pythonBuiltinFunc __import__ abs all any ascii
236252
syn keyword pythonBuiltinFunc bin bool bytearray bytes
237253
syn keyword pythonBuiltinFunc chr classmethod cmp compile complex
238254
syn keyword pythonBuiltinFunc delattr dict dir divmod enumerate eval
239255
syn keyword pythonBuiltinFunc exec filter float format frozenset getattr
240-
syn keyword pythonBuiltinFunc globals hasattr hash hex id
256+
syn keyword pythonBuiltinFunc globals hasattr hash hex id
241257
syn keyword pythonBuiltinFunc input int isinstance
242258
syn keyword pythonBuiltinFunc issubclass iter len list locals map max
243259
syn keyword pythonBuiltinFunc memoryview min next object oct open ord

0 commit comments

Comments
 (0)