blob: ff583256a55f6f44fc4b2a5c8451a892c1a64436 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: Python
Bram Moolenaar541f92d2015-06-19 13:27:23 +02003" Maintainer: Zvezdan Petkovic <zpetkovic@acm.org>
Bram Moolenaardd60c362023-02-27 15:49:53 +00004" Last Change: 2023 Feb 26
Bram Moolenaar541f92d2015-06-19 13:27:23 +02005" Credits: Neil Schemenauer <nas@python.ca>
Bram Moolenaar5c736222010-01-06 20:54:52 +01006" Dmitry Vasiliev
Bram Moolenaar071d4272004-06-13 20:20:40 +00007"
Bram Moolenaar5c736222010-01-06 20:54:52 +01008" This version is a major rewrite by Zvezdan Petkovic.
Bram Moolenaar071d4272004-06-13 20:20:40 +00009"
Bram Moolenaar5c736222010-01-06 20:54:52 +010010" - introduced highlighting of doctests
11" - updated keywords, built-ins, and exceptions
12" - corrected regular expressions for
Bram Moolenaar071d4272004-06-13 20:20:40 +000013"
Bram Moolenaar5c736222010-01-06 20:54:52 +010014" * functions
15" * decorators
16" * strings
17" * escapes
18" * numbers
19" * space error
Bram Moolenaar071d4272004-06-13 20:20:40 +000020"
Bram Moolenaar5c736222010-01-06 20:54:52 +010021" - corrected synchronization
22" - more highlighting is ON by default, except
23" - space error highlighting is OFF by default
Bram Moolenaar071d4272004-06-13 20:20:40 +000024"
Bram Moolenaar5c736222010-01-06 20:54:52 +010025" Optional highlighting can be controlled using these variables.
Bram Moolenaar071d4272004-06-13 20:20:40 +000026"
Bram Moolenaar5c736222010-01-06 20:54:52 +010027" let python_no_builtin_highlight = 1
28" let python_no_doctest_code_highlight = 1
29" let python_no_doctest_highlight = 1
30" let python_no_exception_highlight = 1
31" let python_no_number_highlight = 1
32" let python_space_error_highlight = 1
Bram Moolenaar071d4272004-06-13 20:20:40 +000033"
Bram Moolenaar5c736222010-01-06 20:54:52 +010034" All the options above can be switched on together.
Bram Moolenaar071d4272004-06-13 20:20:40 +000035"
Bram Moolenaar5c736222010-01-06 20:54:52 +010036" let python_highlight_all = 1
Bram Moolenaar071d4272004-06-13 20:20:40 +000037"
Bram Moolenaardd60c362023-02-27 15:49:53 +000038" The use of Python 2 compatible syntax highlighting can be enforced.
39" The straddling code (Python 2 and 3 compatible), up to Python 3.5,
40" will be also supported.
41"
42" let python_use_python2_syntax = 1
43"
44" This option will exclude all modern Python 3.6 or higher features.
45"
Bram Moolenaar071d4272004-06-13 20:20:40 +000046
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020047" quit when a syntax file was already loaded.
48if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +000049 finish
50endif
51
Bram Moolenaardd60c362023-02-27 15:49:53 +000052" Use of Python 2 and 3.5 or lower requested.
53if exists("python_use_python2_syntax")
54 runtime! syntax/python2.vim
55 finish
56endif
57
Bram Moolenaar00659062010-09-21 22:34:02 +020058" We need nocompatible mode in order to continue lines with backslashes.
59" Original setting will be restored.
60let s:cpo_save = &cpo
61set cpo&vim
62
Bram Moolenaarb4ada792016-10-30 21:55:26 +010063if exists("python_no_doctest_highlight")
64 let python_no_doctest_code_highlight = 1
65endif
66
67if exists("python_highlight_all")
68 if exists("python_no_builtin_highlight")
69 unlet python_no_builtin_highlight
70 endif
71 if exists("python_no_doctest_code_highlight")
72 unlet python_no_doctest_code_highlight
73 endif
74 if exists("python_no_doctest_highlight")
75 unlet python_no_doctest_highlight
76 endif
77 if exists("python_no_exception_highlight")
78 unlet python_no_exception_highlight
79 endif
80 if exists("python_no_number_highlight")
81 unlet python_no_number_highlight
82 endif
83 let python_space_error_highlight = 1
84endif
85
Bram Moolenaar5c736222010-01-06 20:54:52 +010086" Keep Python keywords in alphabetical order inside groups for easy
87" comparison with the table in the 'Python Language Reference'
Bram Moolenaar9faec4e2021-02-27 16:38:07 +010088" https://docs.python.org/reference/lexical_analysis.html#keywords.
Bram Moolenaar5c736222010-01-06 20:54:52 +010089" Groups are in the order presented in NAMING CONVENTIONS in syntax.txt.
90" Exceptions come last at the end of each group (class and def below).
91"
Bram Moolenaar9faec4e2021-02-27 16:38:07 +010092" The list can be checked using:
Bram Moolenaar5c736222010-01-06 20:54:52 +010093"
Bram Moolenaar0e6adf82021-12-16 14:41:10 +000094" python3 -c 'import keyword, pprint; pprint.pprint(keyword.kwlist + keyword.softkwlist, compact=True)'
Bram Moolenaar5c736222010-01-06 20:54:52 +010095"
Bram Moolenaar6f1d9a02016-07-24 14:12:38 +020096syn keyword pythonStatement False None True
Bram Moolenaar9faec4e2021-02-27 16:38:07 +010097syn keyword pythonStatement as assert break continue del global
98syn keyword pythonStatement lambda nonlocal pass return with yield
Bram Moolenaar5c736222010-01-06 20:54:52 +010099syn keyword pythonStatement class def nextgroup=pythonFunction skipwhite
100syn keyword pythonConditional elif else if
Bram Moolenaar071d4272004-06-13 20:20:40 +0000101syn keyword pythonRepeat for while
Bram Moolenaar071d4272004-06-13 20:20:40 +0000102syn keyword pythonOperator and in is not or
Bram Moolenaar5c736222010-01-06 20:54:52 +0100103syn keyword pythonException except finally raise try
104syn keyword pythonInclude from import
Bram Moolenaarca635012015-09-25 20:34:21 +0200105syn keyword pythonAsync async await
Bram Moolenaar071d4272004-06-13 20:20:40 +0000106
Bram Moolenaar2ecbe532022-07-29 21:36:21 +0100107" Soft keywords
Bram Moolenaardd60c362023-02-27 15:49:53 +0000108" These keywords do not mean anything unless used in the right context.
109" See https://docs.python.org/3/reference/lexical_analysis.html#soft-keywords
Bram Moolenaar2ecbe532022-07-29 21:36:21 +0100110" for more on this.
111syn match pythonConditional "^\s*\zscase\%(\s\+.*:.*$\)\@="
112syn match pythonConditional "^\s*\zsmatch\%(\s\+.*:\s*\%(#.*\)\=$\)\@="
113
Bram Moolenaar9faec4e2021-02-27 16:38:07 +0100114" Decorators
Bram Moolenaar5c736222010-01-06 20:54:52 +0100115" A dot must be allowed because of @MyClass.myfunc decorators.
Bram Moolenaarb4ada792016-10-30 21:55:26 +0100116syn match pythonDecorator "@" display contained
117syn match pythonDecoratorName "@\s*\h\%(\w\|\.\)*" display contains=pythonDecorator
Bram Moolenaare4a3bcf2016-08-26 19:52:37 +0200118
Bram Moolenaarb4ada792016-10-30 21:55:26 +0100119" Python 3.5 introduced the use of the same symbol for matrix multiplication:
120" https://www.python.org/dev/peps/pep-0465/. We now have to exclude the
121" symbol from highlighting when used in that context.
122" Single line multiplication.
123syn match pythonMatrixMultiply
124 \ "\%(\w\|[])]\)\s*@"
125 \ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonFunction,pythonDoctestValue
126 \ transparent
127" Multiplication continued on the next line after backslash.
128syn match pythonMatrixMultiply
129 \ "[^\\]\\\s*\n\%(\s*\.\.\.\s\)\=\s\+@"
130 \ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonFunction,pythonDoctestValue
131 \ transparent
132" Multiplication in a parenthesized expression over multiple lines with @ at
133" the start of each continued line; very similar to decorators and complex.
134syn match pythonMatrixMultiply
135 \ "^\s*\%(\%(>>>\|\.\.\.\)\s\+\)\=\zs\%(\h\|\%(\h\|[[(]\).\{-}\%(\w\|[])]\)\)\s*\n\%(\s*\.\.\.\s\)\=\s\+@\%(.\{-}\n\%(\s*\.\.\.\s\)\=\s\+@\)*"
136 \ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonFunction,pythonDoctestValue
137 \ transparent
138
139syn match pythonFunction "\h\w*" display contained
Bram Moolenaar9c102382006-05-03 21:26:49 +0000140
Bram Moolenaar5c736222010-01-06 20:54:52 +0100141syn match pythonComment "#.*$" contains=pythonTodo,@Spell
142syn keyword pythonTodo FIXME NOTE NOTES TODO XXX contained
143
144" Triple-quoted strings can contain doctests.
Bram Moolenaar541f92d2015-06-19 13:27:23 +0200145syn region pythonString matchgroup=pythonQuotes
Bram Moolenaar5c736222010-01-06 20:54:52 +0100146 \ start=+[uU]\=\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
147 \ contains=pythonEscape,@Spell
Bram Moolenaar541f92d2015-06-19 13:27:23 +0200148syn region pythonString matchgroup=pythonTripleQuotes
Bram Moolenaar5c736222010-01-06 20:54:52 +0100149 \ start=+[uU]\=\z('''\|"""\)+ end="\z1" keepend
150 \ contains=pythonEscape,pythonSpaceError,pythonDoctest,@Spell
Bram Moolenaar541f92d2015-06-19 13:27:23 +0200151syn region pythonRawString matchgroup=pythonQuotes
Bram Moolenaar5c736222010-01-06 20:54:52 +0100152 \ start=+[uU]\=[rR]\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
153 \ contains=@Spell
Bram Moolenaar541f92d2015-06-19 13:27:23 +0200154syn region pythonRawString matchgroup=pythonTripleQuotes
Bram Moolenaar5c736222010-01-06 20:54:52 +0100155 \ start=+[uU]\=[rR]\z('''\|"""\)+ end="\z1" keepend
156 \ contains=pythonSpaceError,pythonDoctest,@Spell
157
158syn match pythonEscape +\\[abfnrtv'"\\]+ contained
159syn match pythonEscape "\\\o\{1,3}" contained
160syn match pythonEscape "\\x\x\{2}" contained
161syn match pythonEscape "\%(\\u\x\{4}\|\\U\x\{8}\)" contained
162" Python allows case-insensitive Unicode IDs: http://www.unicode.org/charts/
Bram Moolenaar541f92d2015-06-19 13:27:23 +0200163syn match pythonEscape "\\N{\a\+\%(\s\a\+\)*}" contained
Bram Moolenaar5c736222010-01-06 20:54:52 +0100164syn match pythonEscape "\\$"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000165
Bram Moolenaar5c736222010-01-06 20:54:52 +0100166" It is very important to understand all details before changing the
167" regular expressions below or their order.
168" The word boundaries are *not* the floating-point number boundaries
169" because of a possible leading or trailing decimal point.
170" The expressions below ensure that all valid number literals are
171" highlighted, and invalid number literals are not. For example,
172"
173" - a decimal point in '4.' at the end of a line is highlighted,
174" - a second dot in 1.0.0 is not highlighted,
175" - 08 is not highlighted,
176" - 08e0 or 08j are highlighted,
177"
178" and so on, as specified in the 'Python Language Reference'.
Bram Moolenaar9faec4e2021-02-27 16:38:07 +0100179" https://docs.python.org/reference/lexical_analysis.html#numeric-literals
Bram Moolenaar5c736222010-01-06 20:54:52 +0100180if !exists("python_no_number_highlight")
Bram Moolenaar071d4272004-06-13 20:20:40 +0000181 " numbers (including longs and complex)
Bram Moolenaar5c736222010-01-06 20:54:52 +0100182 syn match pythonNumber "\<0[oO]\=\o\+[Ll]\=\>"
183 syn match pythonNumber "\<0[xX]\x\+[Ll]\=\>"
184 syn match pythonNumber "\<0[bB][01]\+[Ll]\=\>"
185 syn match pythonNumber "\<\%([1-9]\d*\|0\)[Ll]\=\>"
186 syn match pythonNumber "\<\d\+[jJ]\>"
187 syn match pythonNumber "\<\d\+[eE][+-]\=\d\+[jJ]\=\>"
188 syn match pythonNumber
189 \ "\<\d\+\.\%([eE][+-]\=\d\+\)\=[jJ]\=\%(\W\|$\)\@="
190 syn match pythonNumber
Bram Moolenaarf9132812015-07-21 19:19:13 +0200191 \ "\%(^\|\W\)\zs\d*\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000192endif
193
Bram Moolenaar5c736222010-01-06 20:54:52 +0100194" Group the built-ins in the order in the 'Python Library Reference' for
195" easier comparison.
Bram Moolenaar9faec4e2021-02-27 16:38:07 +0100196" https://docs.python.org/library/constants.html
197" http://docs.python.org/library/functions.html
Bram Moolenaar5c736222010-01-06 20:54:52 +0100198" Python built-in functions are in alphabetical order.
Bram Moolenaar9faec4e2021-02-27 16:38:07 +0100199"
200" The list can be checked using:
201"
202" python3 -c 'import builtins, pprint; pprint.pprint(dir(builtins), compact=True)'
203"
204" The constants added by the `site` module are not listed below because they
205" should not be used in programs, only in interactive interpreter.
206" Similarly for some other attributes and functions `__`-enclosed from the
207" output of the above command.
208"
Bram Moolenaar5c736222010-01-06 20:54:52 +0100209if !exists("python_no_builtin_highlight")
210 " built-in constants
Bram Moolenaarf9132812015-07-21 19:19:13 +0200211 " 'False', 'True', and 'None' are also reserved words in Python 3
Bram Moolenaar5c736222010-01-06 20:54:52 +0100212 syn keyword pythonBuiltin False True None
213 syn keyword pythonBuiltin NotImplemented Ellipsis __debug__
Bram Moolenaar9faec4e2021-02-27 16:38:07 +0100214 " constants added by the `site` module
215 syn keyword pythonBuiltin quit exit copyright credits license
Bram Moolenaar5c736222010-01-06 20:54:52 +0100216 " built-in functions
Bram Moolenaar9faec4e2021-02-27 16:38:07 +0100217 syn keyword pythonBuiltin abs all any ascii bin bool breakpoint bytearray
218 syn keyword pythonBuiltin bytes callable chr classmethod compile complex
219 syn keyword pythonBuiltin delattr dict dir divmod enumerate eval exec
220 syn keyword pythonBuiltin filter float format frozenset getattr globals
221 syn keyword pythonBuiltin hasattr hash help hex id input int isinstance
Bram Moolenaar5c736222010-01-06 20:54:52 +0100222 syn keyword pythonBuiltin issubclass iter len list locals map max
Bram Moolenaarf9132812015-07-21 19:19:13 +0200223 syn keyword pythonBuiltin memoryview min next object oct open ord pow
224 syn keyword pythonBuiltin print property range repr reversed round set
Bram Moolenaar9faec4e2021-02-27 16:38:07 +0100225 syn keyword pythonBuiltin setattr slice sorted staticmethod str sum super
226 syn keyword pythonBuiltin tuple type vars zip __import__
Bram Moolenaar77cdfd12016-03-12 12:57:59 +0100227 " avoid highlighting attributes as builtins
Bram Moolenaarb4ada792016-10-30 21:55:26 +0100228 syn match pythonAttribute /\.\h\w*/hs=s+1
229 \ contains=ALLBUT,pythonBuiltin,pythonFunction,pythonAsync
230 \ transparent
Bram Moolenaar071d4272004-06-13 20:20:40 +0000231endif
232
Bram Moolenaar5c736222010-01-06 20:54:52 +0100233" From the 'Python Library Reference' class hierarchy at the bottom.
Bram Moolenaar9faec4e2021-02-27 16:38:07 +0100234" http://docs.python.org/library/exceptions.html
Bram Moolenaar5c736222010-01-06 20:54:52 +0100235if !exists("python_no_exception_highlight")
Bram Moolenaarf9132812015-07-21 19:19:13 +0200236 " builtin base exceptions (used mostly as base classes for other exceptions)
Bram Moolenaar5c736222010-01-06 20:54:52 +0100237 syn keyword pythonExceptions BaseException Exception
Bram Moolenaar9faec4e2021-02-27 16:38:07 +0100238 syn keyword pythonExceptions ArithmeticError BufferError LookupError
Bram Moolenaar5c736222010-01-06 20:54:52 +0100239 " builtin exceptions (actually raised)
Bram Moolenaar9faec4e2021-02-27 16:38:07 +0100240 syn keyword pythonExceptions AssertionError AttributeError EOFError
241 syn keyword pythonExceptions FloatingPointError GeneratorExit ImportError
242 syn keyword pythonExceptions IndentationError IndexError KeyError
243 syn keyword pythonExceptions KeyboardInterrupt MemoryError
244 syn keyword pythonExceptions ModuleNotFoundError NameError
245 syn keyword pythonExceptions NotImplementedError OSError OverflowError
246 syn keyword pythonExceptions RecursionError ReferenceError RuntimeError
247 syn keyword pythonExceptions StopAsyncIteration StopIteration SyntaxError
Bram Moolenaar5c736222010-01-06 20:54:52 +0100248 syn keyword pythonExceptions SystemError SystemExit TabError TypeError
Bram Moolenaar9faec4e2021-02-27 16:38:07 +0100249 syn keyword pythonExceptions UnboundLocalError UnicodeDecodeError
250 syn keyword pythonExceptions UnicodeEncodeError UnicodeError
Bram Moolenaarf9132812015-07-21 19:19:13 +0200251 syn keyword pythonExceptions UnicodeTranslateError ValueError
252 syn keyword pythonExceptions ZeroDivisionError
Bram Moolenaar9faec4e2021-02-27 16:38:07 +0100253 " builtin exception aliases for OSError
254 syn keyword pythonExceptions EnvironmentError IOError WindowsError
Bram Moolenaarf9132812015-07-21 19:19:13 +0200255 " builtin OS exceptions in Python 3
256 syn keyword pythonExceptions BlockingIOError BrokenPipeError
257 syn keyword pythonExceptions ChildProcessError ConnectionAbortedError
258 syn keyword pythonExceptions ConnectionError ConnectionRefusedError
259 syn keyword pythonExceptions ConnectionResetError FileExistsError
260 syn keyword pythonExceptions FileNotFoundError InterruptedError
261 syn keyword pythonExceptions IsADirectoryError NotADirectoryError
Bram Moolenaar9faec4e2021-02-27 16:38:07 +0100262 syn keyword pythonExceptions PermissionError ProcessLookupError TimeoutError
Bram Moolenaar5c736222010-01-06 20:54:52 +0100263 " builtin warnings
264 syn keyword pythonExceptions BytesWarning DeprecationWarning FutureWarning
265 syn keyword pythonExceptions ImportWarning PendingDeprecationWarning
Bram Moolenaar9faec4e2021-02-27 16:38:07 +0100266 syn keyword pythonExceptions ResourceWarning RuntimeWarning
267 syn keyword pythonExceptions SyntaxWarning UnicodeWarning
Bram Moolenaar5c736222010-01-06 20:54:52 +0100268 syn keyword pythonExceptions UserWarning Warning
Bram Moolenaar071d4272004-06-13 20:20:40 +0000269endif
270
Bram Moolenaar5c736222010-01-06 20:54:52 +0100271if exists("python_space_error_highlight")
Bram Moolenaar071d4272004-06-13 20:20:40 +0000272 " trailing whitespace
Bram Moolenaar5c736222010-01-06 20:54:52 +0100273 syn match pythonSpaceError display excludenl "\s\+$"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000274 " mixed tabs and spaces
Bram Moolenaar5c736222010-01-06 20:54:52 +0100275 syn match pythonSpaceError display " \+\t"
276 syn match pythonSpaceError display "\t\+ "
Bram Moolenaar071d4272004-06-13 20:20:40 +0000277endif
278
Bram Moolenaar5c736222010-01-06 20:54:52 +0100279" Do not spell doctests inside strings.
280" Notice that the end of a string, either ''', or """, will end the contained
281" doctest too. Thus, we do *not* need to have it as an end pattern.
282if !exists("python_no_doctest_highlight")
Bram Moolenaar34700a62013-03-07 13:20:54 +0100283 if !exists("python_no_doctest_code_highlight")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100284 syn region pythonDoctest
285 \ start="^\s*>>>\s" end="^\s*$"
Bram Moolenaarb4ada792016-10-30 21:55:26 +0100286 \ contained contains=ALLBUT,pythonDoctest,pythonFunction,@Spell
Bram Moolenaar5c736222010-01-06 20:54:52 +0100287 syn region pythonDoctestValue
288 \ start=+^\s*\%(>>>\s\|\.\.\.\s\|"""\|'''\)\@!\S\++ end="$"
289 \ contained
290 else
291 syn region pythonDoctest
292 \ start="^\s*>>>" end="^\s*$"
293 \ contained contains=@NoSpell
294 endif
295endif
296
297" Sync at the beginning of class, function, or method definition.
Bram Moolenaarb4ada792016-10-30 21:55:26 +0100298syn sync match pythonSync grouphere NONE "^\%(def\|class\)\s\+\h\w*\s*[(:]"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000299
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200300" The default highlight links. Can be overridden later.
Bram Moolenaard0796902016-09-16 20:02:31 +0200301hi def link pythonStatement Statement
302hi def link pythonConditional Conditional
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200303hi def link pythonRepeat Repeat
304hi def link pythonOperator Operator
Bram Moolenaard0796902016-09-16 20:02:31 +0200305hi def link pythonException Exception
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200306hi def link pythonInclude Include
Bram Moolenaard0796902016-09-16 20:02:31 +0200307hi def link pythonAsync Statement
308hi def link pythonDecorator Define
309hi def link pythonDecoratorName Function
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200310hi def link pythonFunction Function
311hi def link pythonComment Comment
Bram Moolenaard0796902016-09-16 20:02:31 +0200312hi def link pythonTodo Todo
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200313hi def link pythonString String
Bram Moolenaard0796902016-09-16 20:02:31 +0200314hi def link pythonRawString String
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200315hi def link pythonQuotes String
Bram Moolenaard0796902016-09-16 20:02:31 +0200316hi def link pythonTripleQuotes pythonQuotes
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200317hi def link pythonEscape Special
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200318if !exists("python_no_number_highlight")
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200319 hi def link pythonNumber Number
Bram Moolenaar071d4272004-06-13 20:20:40 +0000320endif
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200321if !exists("python_no_builtin_highlight")
Bram Moolenaard0796902016-09-16 20:02:31 +0200322 hi def link pythonBuiltin Function
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200323endif
324if !exists("python_no_exception_highlight")
Bram Moolenaard0796902016-09-16 20:02:31 +0200325 hi def link pythonExceptions Structure
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200326endif
327if exists("python_space_error_highlight")
Bram Moolenaard0796902016-09-16 20:02:31 +0200328 hi def link pythonSpaceError Error
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200329endif
330if !exists("python_no_doctest_highlight")
Bram Moolenaard0796902016-09-16 20:02:31 +0200331 hi def link pythonDoctest Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200332 hi def link pythonDoctestValue Define
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200333endif
334
Bram Moolenaar071d4272004-06-13 20:20:40 +0000335let b:current_syntax = "python"
336
Bram Moolenaar00659062010-09-21 22:34:02 +0200337let &cpo = s:cpo_save
338unlet s:cpo_save
339
Bram Moolenaar5c736222010-01-06 20:54:52 +0100340" vim:set sw=2 sts=2 ts=8 noet: