Browse Source

Added options python_highlight_builtin_objs and python_highlight_builtin_funcs

Dmitry Vasiliev 14 years ago
parent
commit
d702136252
2 changed files with 27 additions and 6 deletions
  1. 5
    0
      CHANGES.txt
  2. 22
    6
      python3.0.vim

+ 5
- 0
CHANGES.txt View File

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
+
1
 Revision 3.0.2 (2009-07-24):
6
 Revision 3.0.2 (2009-07-24):
2
 
7
 
3
     - Applied patch by Caleb Adamantine which fixes highlighting for decorators
8
     - Applied patch by Caleb Adamantine which fixes highlighting for decorators

+ 22
- 6
python3.0.vim View File

2
 " Language:	Python
2
 " Language:	Python
3
 " Maintainer:	Dmitry Vasiliev <dima@hlabs.spb.ru>
3
 " Maintainer:	Dmitry Vasiliev <dima@hlabs.spb.ru>
4
 " URL:		http://www.hlabs.spb.ru/vim/python3.0.vim
4
 " URL:		http://www.hlabs.spb.ru/vim/python3.0.vim
5
-" Last Change:	2009-07-24
5
+" Last Change:	2010-04-09
6
 " Filenames:	*.py
6
 " Filenames:	*.py
7
-" Version:	3.0.2
7
+" Version:	3.0.3
8
 "
8
 "
9
 " Based on python.vim (from Vim 6.1 distribution)
9
 " Based on python.vim (from Vim 6.1 distribution)
10
 " by Neil Schemenauer <nas@python.ca>
10
 " by Neil Schemenauer <nas@python.ca>
20
 "        for the patch fixing small typo
20
 "        for the patch fixing small typo
21
 "    Caleb Adamantine
21
 "    Caleb Adamantine
22
 "        for the patch fixing highlighting for decorators
22
 "        for the patch fixing highlighting for decorators
23
+"    Andrea Riciputi
24
+"        for the patch with new configuration options
23
 
25
 
24
 "
26
 "
25
 " Options:
27
 " Options:
32
 "    For highlight builtin functions:
34
 "    For highlight builtin functions:
33
 "       python_highlight_builtins
35
 "       python_highlight_builtins
34
 "
36
 "
37
+"    For highlight builtin objects:
38
+"       python_highlight_builtin_objs
39
+"
40
+"    For highlight builtin funtions:
41
+"       python_highlight_builtin_funcs
42
+"
35
 "    For highlight standard exceptions:
43
 "    For highlight standard exceptions:
36
 "       python_highlight_exceptions
44
 "       python_highlight_exceptions
37
 "
45
 "
71
 if exists("python_highlight_all") && python_highlight_all != 0
79
 if exists("python_highlight_all") && python_highlight_all != 0
72
   " Not override previously set options
80
   " Not override previously set options
73
   if !exists("python_highlight_builtins")
81
   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
75
   endif
88
   endif
76
   if !exists("python_highlight_exceptions")
89
   if !exists("python_highlight_exceptions")
77
     let python_highlight_exceptions = 1
90
     let python_highlight_exceptions = 1
227
 syn match   pythonOctError	"\<0[oO]\=\o*[8-9]\d*\>" display
240
 syn match   pythonOctError	"\<0[oO]\=\o*[8-9]\d*\>" display
228
 syn match   pythonBinError	"\<0[bB][01]*[2-9]\d*\>" display
241
 syn match   pythonBinError	"\<0[bB][01]*[2-9]\d*\>" display
229
 
242
 
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
232
   syn keyword pythonBuiltinObj	Ellipsis NotImplemented
245
   syn keyword pythonBuiltinObj	Ellipsis NotImplemented
233
   syn keyword pythonBuiltinObj	__debug__ __doc__ __file__ __name__ __package__
246
   syn keyword pythonBuiltinObj	__debug__ __doc__ __file__ __name__ __package__
247
+endif
234
 
248
 
249
+if exists("python_highlight_builtin_funcs") && python_highlight_builtin_funcs != 0
250
+  " Builtin functions
235
   syn keyword pythonBuiltinFunc	__import__ abs all any ascii
251
   syn keyword pythonBuiltinFunc	__import__ abs all any ascii
236
   syn keyword pythonBuiltinFunc	bin bool bytearray bytes
252
   syn keyword pythonBuiltinFunc	bin bool bytearray bytes
237
   syn keyword pythonBuiltinFunc	chr classmethod cmp compile complex
253
   syn keyword pythonBuiltinFunc	chr classmethod cmp compile complex
238
   syn keyword pythonBuiltinFunc	delattr dict dir divmod enumerate eval
254
   syn keyword pythonBuiltinFunc	delattr dict dir divmod enumerate eval
239
   syn keyword pythonBuiltinFunc	exec filter float format frozenset getattr
255
   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
241
   syn keyword pythonBuiltinFunc	input int isinstance
257
   syn keyword pythonBuiltinFunc	input int isinstance
242
   syn keyword pythonBuiltinFunc	issubclass iter len list locals map max
258
   syn keyword pythonBuiltinFunc	issubclass iter len list locals map max
243
   syn keyword pythonBuiltinFunc	memoryview min next object oct open ord
259
   syn keyword pythonBuiltinFunc	memoryview min next object oct open ord