Skip to content

Commit 67033ee

Browse files
committed
Add an option to turn off the custom syntax highlighting.
1 parent d0e8322 commit 67033ee

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

README.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ Default values: ::
222222
" Set default pymode python other options
223223
let g:pymode_options_other = 1
224224

225+
" Enable pymode's custom syntax highlighting
226+
let g:pymode_syntax = 1
227+
225228

226229
Default keys
227230
============

doc/pymode.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ PythonMode. These options should be set in your vimrc.
7575

7676
|'pymode_utils_whitespaces'| Remove unused whitespaces
7777

78+
|'pymode_syntax'| Turns off the custom syntax highlighting
79+
7880
|'pymode_options_indent'| Set default pymode options for
7981
python indentation
8082

@@ -233,6 +235,14 @@ Default: 1.
233235

234236
Autoremove unused whitespaces
235237

238+
------------------------------------------------------------------------------
239+
*'pymode_syntax'*
240+
Values: 0 or 1.
241+
Default: 1.
242+
243+
If this option is set to 0 then the custom syntax highlighting will
244+
not be used.
245+
236246
------------------------------------------------------------------------------
237247
*'pymode_options_indent'*
238248
Values: 0 or 1.

ftplugin/python/pymode.vim

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ if pymode#Default('b:pymode', 1)
33
endif
44

55
" Syntax highlight
6-
let python_highlight_all=1
7-
let python_highlight_exceptions=1
8-
let python_highlight_builtins=1
6+
if !pymode#Default('g:pymode_syntax', 1) || g:pymode_syntax
7+
let python_highlight_all=1
8+
let python_highlight_exceptions=1
9+
let python_highlight_builtins=1
10+
endif
911

1012
" Python indent options
1113
if !pymode#Default('g:pymode_options_indent', 1) || g:pymode_options_indent

syntax/python.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ if version < 600
7777
syntax clear
7878
elseif exists("b:current_syntax")
7979
finish
80+
elseif exists("g:pymode_syntax") && g:pymode_syntax == 0
81+
finish
8082
endif
8183

8284
if exists("python_highlight_all") && python_highlight_all != 0

0 commit comments

Comments
 (0)