Browse Source

Added option for highligh print as a function

Dmitry Vasiliev 15 years ago
parent
commit
bbac2dd2f8
2 changed files with 15 additions and 3 deletions
  1. 2
    0
      CHANGES.txt
  2. 13
    3
      python.vim

+ 2
- 0
CHANGES.txt View File

6
     - Added "magic" global variables: "__doc__", "__file__", "__name__",
6
     - Added "magic" global variables: "__doc__", "__file__", "__name__",
7
       "__package__";
7
       "__package__";
8
     - Removed "OverflowWarning" (removed in Python 2.5);
8
     - Removed "OverflowWarning" (removed in Python 2.5);
9
+    - Added option "python_print_as_function" for highlight "print" as a
10
+      function;
9
 
11
 
10
 Revision 2.5.6 (2007-02-04):
12
 Revision 2.5.6 (2007-02-04):
11
 
13
 

+ 13
- 3
python.vim View File

46
 "    For highlight doc-tests:
46
 "    For highlight doc-tests:
47
 "       python_highlight_doctests
47
 "       python_highlight_doctests
48
 "
48
 "
49
-"    If you want all possible Python highlighting:
50
-"    (This option not override previously set options)
49
+"    If you want all Python highlightings above:
51
 "       python_highlight_all
50
 "       python_highlight_all
51
+"    (This option not override previously set options)
52
 "
52
 "
53
 "    For fast machines:
53
 "    For fast machines:
54
 "       python_slow_sync
54
 "       python_slow_sync
55
 "
55
 "
56
+"    For "print" builtin as function:
57
+"       python_print_as_function
56
 
58
 
57
 " For version 5.x: Clear all syntax items
59
 " For version 5.x: Clear all syntax items
58
 " For version 6.x: Quit when a syntax file was already loaded
60
 " For version 6.x: Quit when a syntax file was already loaded
99
 syn keyword pythonException	try except finally
101
 syn keyword pythonException	try except finally
100
 syn keyword pythonOperator	and in is not or
102
 syn keyword pythonOperator	and in is not or
101
 
103
 
104
+if !exists("python_print_as_function") || python_print_as_function == 0
105
+  syn keyword pythonStatement print
106
+endif
107
+
102
 " Decorators (new in Python 2.4)
108
 " Decorators (new in Python 2.4)
103
 syn match   pythonDecorator	"@" display nextgroup=pythonFunction skipwhite
109
 syn match   pythonDecorator	"@" display nextgroup=pythonFunction skipwhite
104
 
110
 
205
   syn keyword pythonBuiltinFunc	input int intern isinstance
211
   syn keyword pythonBuiltinFunc	input int intern isinstance
206
   syn keyword pythonBuiltinFunc	issubclass iter len list locals long map max
212
   syn keyword pythonBuiltinFunc	issubclass iter len list locals long map max
207
   syn keyword pythonBuiltinFunc	min next object oct open ord
213
   syn keyword pythonBuiltinFunc	min next object oct open ord
208
-  syn keyword pythonBuiltinFunc	pow print property range
214
+  syn keyword pythonBuiltinFunc	pow property range
209
   syn keyword pythonBuiltinFunc	raw_input reduce reload repr
215
   syn keyword pythonBuiltinFunc	raw_input reduce reload repr
210
   syn keyword pythonBuiltinFunc	reversed round set setattr
216
   syn keyword pythonBuiltinFunc	reversed round set setattr
211
   syn keyword pythonBuiltinFunc	slice sorted staticmethod str sum super tuple
217
   syn keyword pythonBuiltinFunc	slice sorted staticmethod str sum super tuple
212
   syn keyword pythonBuiltinFunc	type unichr unicode vars xrange zip
218
   syn keyword pythonBuiltinFunc	type unichr unicode vars xrange zip
219
+
220
+  if exists("python_print_as_function") && python_print_as_function != 0
221
+      syn keyword pythonBuiltinFunc	print
222
+  endif
213
 endif
223
 endif
214
 
224
 
215
 if exists("python_highlight_exceptions") && python_highlight_exceptions != 0
225
 if exists("python_highlight_exceptions") && python_highlight_exceptions != 0