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,6 +6,8 @@ Revision 2.6.1 (unknown):
6 6
     - Added "magic" global variables: "__doc__", "__file__", "__name__",
7 7
       "__package__";
8 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 12
 Revision 2.5.6 (2007-02-04):
11 13
 

+ 13
- 3
python.vim View File

@@ -46,13 +46,15 @@
46 46
 "    For highlight doc-tests:
47 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 50
 "       python_highlight_all
51
+"    (This option not override previously set options)
52 52
 "
53 53
 "    For fast machines:
54 54
 "       python_slow_sync
55 55
 "
56
+"    For "print" builtin as function:
57
+"       python_print_as_function
56 58
 
57 59
 " For version 5.x: Clear all syntax items
58 60
 " For version 6.x: Quit when a syntax file was already loaded
@@ -99,6 +101,10 @@ syn keyword pythonImport	import from as
99 101
 syn keyword pythonException	try except finally
100 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 108
 " Decorators (new in Python 2.4)
103 109
 syn match   pythonDecorator	"@" display nextgroup=pythonFunction skipwhite
104 110
 
@@ -205,11 +211,15 @@ if exists("python_highlight_builtins") && python_highlight_builtins != 0
205 211
   syn keyword pythonBuiltinFunc	input int intern isinstance
206 212
   syn keyword pythonBuiltinFunc	issubclass iter len list locals long map max
207 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 215
   syn keyword pythonBuiltinFunc	raw_input reduce reload repr
210 216
   syn keyword pythonBuiltinFunc	reversed round set setattr
211 217
   syn keyword pythonBuiltinFunc	slice sorted staticmethod str sum super tuple
212 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 223
 endif
214 224
 
215 225
 if exists("python_highlight_exceptions") && python_highlight_exceptions != 0