|
|
|
|
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/python.vim
|
4
|
" URL: http://www.hlabs.spb.ru/vim/python.vim
|
5
|
-" Last Change: 2009-07-24
|
|
|
|
|
5
|
+" Last Change: 2010-04-09
|
6
|
" Filenames: *.py
|
6
|
" Filenames: *.py
|
7
|
-" Version: 2.6.5
|
|
|
|
|
7
|
+" Version: 2.6.6
|
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:
|
|
|
|
|
29
|
"
|
31
|
"
|
30
|
" Option names:
|
32
|
" Option names:
|
31
|
"
|
33
|
"
|
32
|
-" For highlight builtin functions:
|
|
|
|
|
34
|
+" For highlight builtin functions and objects:
|
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
|
"
|
|
|
|
|
74
|
if exists("python_highlight_all") && python_highlight_all != 0
|
82
|
if exists("python_highlight_all") && python_highlight_all != 0
|
75
|
" Not override previously set options
|
83
|
" Not override previously set options
|
76
|
if !exists("python_highlight_builtins")
|
84
|
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
|
78
|
endif
|
91
|
endif
|
79
|
if !exists("python_highlight_exceptions")
|
92
|
if !exists("python_highlight_exceptions")
|
80
|
let python_highlight_exceptions = 1
|
93
|
let python_highlight_exceptions = 1
|
|
|
|
|
230
|
syn match pythonOctError "\<0[oO]\=\o*[8-9]\d*[lL]\=\>" display
|
243
|
syn match pythonOctError "\<0[oO]\=\o*[8-9]\d*[lL]\=\>" display
|
231
|
syn match pythonBinError "\<0[bB][01]*[2-9]\d*[lL]\=\>" display
|
244
|
syn match pythonBinError "\<0[bB][01]*[2-9]\d*[lL]\=\>" display
|
232
|
|
245
|
|
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
|
235
|
syn keyword pythonBuiltinObj True False Ellipsis None NotImplemented
|
248
|
syn keyword pythonBuiltinObj True False Ellipsis None NotImplemented
|
236
|
syn keyword pythonBuiltinObj __debug__ __doc__ __file__ __name__ __package__
|
249
|
syn keyword pythonBuiltinObj __debug__ __doc__ __file__ __name__ __package__
|
|
|
250
|
+endif
|
237
|
|
251
|
|
|
|
252
|
+if exists("python_highlight_builtin_funcs") && python_highlight_builtin_funcs != 0
|
|
|
253
|
+ " Builtin functions
|
238
|
syn keyword pythonBuiltinFunc __import__ abs all any apply
|
254
|
syn keyword pythonBuiltinFunc __import__ abs all any apply
|
239
|
syn keyword pythonBuiltinFunc basestring bin bool buffer bytearray bytes callable
|
255
|
syn keyword pythonBuiltinFunc basestring bin bool buffer bytearray bytes callable
|
240
|
syn keyword pythonBuiltinFunc chr classmethod cmp coerce compile complex
|
256
|
syn keyword pythonBuiltinFunc chr classmethod cmp coerce compile complex
|
241
|
syn keyword pythonBuiltinFunc delattr dict dir divmod enumerate eval
|
257
|
syn keyword pythonBuiltinFunc delattr dict dir divmod enumerate eval
|
242
|
syn keyword pythonBuiltinFunc execfile file filter float format frozenset getattr
|
258
|
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
|
244
|
syn keyword pythonBuiltinFunc input int intern isinstance
|
260
|
syn keyword pythonBuiltinFunc input int intern isinstance
|
245
|
syn keyword pythonBuiltinFunc issubclass iter len list locals long map max
|
261
|
syn keyword pythonBuiltinFunc issubclass iter len list locals long map max
|
246
|
syn keyword pythonBuiltinFunc min next object oct open ord
|
262
|
syn keyword pythonBuiltinFunc min next object oct open ord
|