Skip to content

Commit bbac2dd

Browse files
committed
Added option for highligh print as a function
1 parent 810414e commit bbac2dd

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Revision 2.6.1 (unknown):
66
- Added "magic" global variables: "__doc__", "__file__", "__name__",
77
"__package__";
88
- Removed "OverflowWarning" (removed in Python 2.5);
9+
- Added option "python_print_as_function" for highlight "print" as a
10+
function;
911

1012
Revision 2.5.6 (2007-02-04):
1113

python.vim

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,15 @@
4646
" For highlight doc-tests:
4747
" python_highlight_doctests
4848
"
49-
" If you want all possible Python highlighting:
50-
" (This option not override previously set options)
49+
" If you want all Python highlightings above:
5150
" python_highlight_all
51+
" (This option not override previously set options)
5252
"
5353
" For fast machines:
5454
" python_slow_sync
5555
"
56+
" For "print" builtin as function:
57+
" python_print_as_function
5658

5759
" For version 5.x: Clear all syntax items
5860
" For version 6.x: Quit when a syntax file was already loaded
@@ -99,6 +101,10 @@ syn keyword pythonImport import from as
99101
syn keyword pythonException try except finally
100102
syn keyword pythonOperator and in is not or
101103

104+
if !exists("python_print_as_function") || python_print_as_function == 0
105+
syn keyword pythonStatement print
106+
endif
107+
102108
" Decorators (new in Python 2.4)
103109
syn match pythonDecorator "@" display nextgroup=pythonFunction skipwhite
104110

@@ -205,11 +211,15 @@ if exists("python_highlight_builtins") && python_highlight_builtins != 0
205211
syn keyword pythonBuiltinFunc input int intern isinstance
206212
syn keyword pythonBuiltinFunc issubclass iter len list locals long map max
207213
syn keyword pythonBuiltinFunc min next object oct open ord
208-
syn keyword pythonBuiltinFunc pow print property range
214+
syn keyword pythonBuiltinFunc pow property range
209215
syn keyword pythonBuiltinFunc raw_input reduce reload repr
210216
syn keyword pythonBuiltinFunc reversed round set setattr
211217
syn keyword pythonBuiltinFunc slice sorted staticmethod str sum super tuple
212218
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
213223
endif
214224

215225
if exists("python_highlight_exceptions") && python_highlight_exceptions != 0

0 commit comments

Comments
 (0)