blob: 23666a14736009fb77dfa048b048232af425ca88 [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 Moolenaarb4ada792016-10-30 21:55:26 +01004" Last Change: 2016 Oct 29
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"
38
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020039" quit when a syntax file was already loaded.
40if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +000041 finish
42endif
43
Bram Moolenaar00659062010-09-21 22:34:02 +020044" We need nocompatible mode in order to continue lines with backslashes.
45" Original setting will be restored.
46let s:cpo_save = &cpo
47set cpo&vim
48
Bram Moolenaarb4ada792016-10-30 21:55:26 +010049if exists("python_no_doctest_highlight")
50 let python_no_doctest_code_highlight = 1
51endif
52
53if exists("python_highlight_all")
54 if exists("python_no_builtin_highlight")
55 unlet python_no_builtin_highlight
56 endif
57 if exists("python_no_doctest_code_highlight")
58 unlet python_no_doctest_code_highlight
59 endif
60 if exists("python_no_doctest_highlight")
61 unlet python_no_doctest_highlight
62 endif
63 if exists("python_no_exception_highlight")
64 unlet python_no_exception_highlight
65 endif
66 if exists("python_no_number_highlight")
67 unlet python_no_number_highlight
68 endif
69 let python_space_error_highlight = 1
70endif
71
Bram Moolenaar5c736222010-01-06 20:54:52 +010072" Keep Python keywords in alphabetical order inside groups for easy
73" comparison with the table in the 'Python Language Reference'
Bram Moolenaarf9132812015-07-21 19:19:13 +020074" https://docs.python.org/2/reference/lexical_analysis.html#keywords,
75" https://docs.python.org/3/reference/lexical_analysis.html#keywords.
Bram Moolenaar5c736222010-01-06 20:54:52 +010076" Groups are in the order presented in NAMING CONVENTIONS in syntax.txt.
77" Exceptions come last at the end of each group (class and def below).
78"
79" Keywords 'with' and 'as' are new in Python 2.6
80" (use 'from __future__ import with_statement' in Python 2.5).
81"
Bram Moolenaarf9132812015-07-21 19:19:13 +020082" Some compromises had to be made to support both Python 3 and 2.
83" We include Python 3 features, but when a definition is duplicated,
Bram Moolenaar5c736222010-01-06 20:54:52 +010084" the last definition takes precedence.
85"
Bram Moolenaarf9132812015-07-21 19:19:13 +020086" - 'False', 'None', and 'True' are keywords in Python 3 but they are
87" built-ins in 2 and will be highlighted as built-ins below.
88" - 'exec' is a built-in in Python 3 and will be highlighted as
Bram Moolenaar5c736222010-01-06 20:54:52 +010089" built-in below.
Bram Moolenaarf9132812015-07-21 19:19:13 +020090" - 'nonlocal' is a keyword in Python 3 and will be highlighted.
91" - 'print' is a built-in in Python 3 and will be highlighted as
92" built-in below (use 'from __future__ import print_function' in 2)
Bram Moolenaarca635012015-09-25 20:34:21 +020093" - async and await were added in Python 3.5 and are soft keywords.
Bram Moolenaar5c736222010-01-06 20:54:52 +010094"
Bram Moolenaar6f1d9a02016-07-24 14:12:38 +020095syn keyword pythonStatement False None True
Bram Moolenaar5c736222010-01-06 20:54:52 +010096syn keyword pythonStatement as assert break continue del exec global
97syn keyword pythonStatement lambda nonlocal pass print return with yield
98syn keyword pythonStatement class def nextgroup=pythonFunction skipwhite
99syn keyword pythonConditional elif else if
Bram Moolenaar071d4272004-06-13 20:20:40 +0000100syn keyword pythonRepeat for while
Bram Moolenaar071d4272004-06-13 20:20:40 +0000101syn keyword pythonOperator and in is not or
Bram Moolenaar5c736222010-01-06 20:54:52 +0100102syn keyword pythonException except finally raise try
103syn keyword pythonInclude from import
Bram Moolenaarca635012015-09-25 20:34:21 +0200104syn keyword pythonAsync async await
Bram Moolenaar071d4272004-06-13 20:20:40 +0000105
Bram Moolenaar9c102382006-05-03 21:26:49 +0000106" Decorators (new in Python 2.4)
Bram Moolenaar5c736222010-01-06 20:54:52 +0100107" A dot must be allowed because of @MyClass.myfunc decorators.
Bram Moolenaarb4ada792016-10-30 21:55:26 +0100108syn match pythonDecorator "@" display contained
109syn match pythonDecoratorName "@\s*\h\%(\w\|\.\)*" display contains=pythonDecorator
Bram Moolenaare4a3bcf2016-08-26 19:52:37 +0200110
Bram Moolenaarb4ada792016-10-30 21:55:26 +0100111" Python 3.5 introduced the use of the same symbol for matrix multiplication:
112" https://www.python.org/dev/peps/pep-0465/. We now have to exclude the
113" symbol from highlighting when used in that context.
114" Single line multiplication.
115syn match pythonMatrixMultiply
116 \ "\%(\w\|[])]\)\s*@"
117 \ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonFunction,pythonDoctestValue
118 \ transparent
119" Multiplication continued on the next line after backslash.
120syn match pythonMatrixMultiply
121 \ "[^\\]\\\s*\n\%(\s*\.\.\.\s\)\=\s\+@"
122 \ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonFunction,pythonDoctestValue
123 \ transparent
124" Multiplication in a parenthesized expression over multiple lines with @ at
125" the start of each continued line; very similar to decorators and complex.
126syn match pythonMatrixMultiply
127 \ "^\s*\%(\%(>>>\|\.\.\.\)\s\+\)\=\zs\%(\h\|\%(\h\|[[(]\).\{-}\%(\w\|[])]\)\)\s*\n\%(\s*\.\.\.\s\)\=\s\+@\%(.\{-}\n\%(\s*\.\.\.\s\)\=\s\+@\)*"
128 \ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonFunction,pythonDoctestValue
129 \ transparent
130
131syn match pythonFunction "\h\w*" display contained
Bram Moolenaar9c102382006-05-03 21:26:49 +0000132
Bram Moolenaar5c736222010-01-06 20:54:52 +0100133syn match pythonComment "#.*$" contains=pythonTodo,@Spell
134syn keyword pythonTodo FIXME NOTE NOTES TODO XXX contained
135
136" Triple-quoted strings can contain doctests.
Bram Moolenaar541f92d2015-06-19 13:27:23 +0200137syn region pythonString matchgroup=pythonQuotes
Bram Moolenaar5c736222010-01-06 20:54:52 +0100138 \ start=+[uU]\=\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
139 \ contains=pythonEscape,@Spell
Bram Moolenaar541f92d2015-06-19 13:27:23 +0200140syn region pythonString matchgroup=pythonTripleQuotes
Bram Moolenaar5c736222010-01-06 20:54:52 +0100141 \ start=+[uU]\=\z('''\|"""\)+ end="\z1" keepend
142 \ contains=pythonEscape,pythonSpaceError,pythonDoctest,@Spell
Bram Moolenaar541f92d2015-06-19 13:27:23 +0200143syn region pythonRawString matchgroup=pythonQuotes
Bram Moolenaar5c736222010-01-06 20:54:52 +0100144 \ start=+[uU]\=[rR]\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
145 \ contains=@Spell
Bram Moolenaar541f92d2015-06-19 13:27:23 +0200146syn region pythonRawString matchgroup=pythonTripleQuotes
Bram Moolenaar5c736222010-01-06 20:54:52 +0100147 \ start=+[uU]\=[rR]\z('''\|"""\)+ end="\z1" keepend
148 \ contains=pythonSpaceError,pythonDoctest,@Spell
149
150syn match pythonEscape +\\[abfnrtv'"\\]+ contained
151syn match pythonEscape "\\\o\{1,3}" contained
152syn match pythonEscape "\\x\x\{2}" contained
153syn match pythonEscape "\%(\\u\x\{4}\|\\U\x\{8}\)" contained
154" Python allows case-insensitive Unicode IDs: http://www.unicode.org/charts/
Bram Moolenaar541f92d2015-06-19 13:27:23 +0200155syn match pythonEscape "\\N{\a\+\%(\s\a\+\)*}" contained
Bram Moolenaar5c736222010-01-06 20:54:52 +0100156syn match pythonEscape "\\$"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000157
Bram Moolenaar5c736222010-01-06 20:54:52 +0100158" It is very important to understand all details before changing the
159" regular expressions below or their order.
160" The word boundaries are *not* the floating-point number boundaries
161" because of a possible leading or trailing decimal point.
162" The expressions below ensure that all valid number literals are
163" highlighted, and invalid number literals are not. For example,
164"
165" - a decimal point in '4.' at the end of a line is highlighted,
166" - a second dot in 1.0.0 is not highlighted,
167" - 08 is not highlighted,
168" - 08e0 or 08j are highlighted,
169"
170" and so on, as specified in the 'Python Language Reference'.
Bram Moolenaarf9132812015-07-21 19:19:13 +0200171" https://docs.python.org/2/reference/lexical_analysis.html#numeric-literals
172" https://docs.python.org/3/reference/lexical_analysis.html#numeric-literals
Bram Moolenaar5c736222010-01-06 20:54:52 +0100173if !exists("python_no_number_highlight")
Bram Moolenaar071d4272004-06-13 20:20:40 +0000174 " numbers (including longs and complex)
Bram Moolenaar5c736222010-01-06 20:54:52 +0100175 syn match pythonNumber "\<0[oO]\=\o\+[Ll]\=\>"
176 syn match pythonNumber "\<0[xX]\x\+[Ll]\=\>"
177 syn match pythonNumber "\<0[bB][01]\+[Ll]\=\>"
178 syn match pythonNumber "\<\%([1-9]\d*\|0\)[Ll]\=\>"
179 syn match pythonNumber "\<\d\+[jJ]\>"
180 syn match pythonNumber "\<\d\+[eE][+-]\=\d\+[jJ]\=\>"
181 syn match pythonNumber
182 \ "\<\d\+\.\%([eE][+-]\=\d\+\)\=[jJ]\=\%(\W\|$\)\@="
183 syn match pythonNumber
Bram Moolenaarf9132812015-07-21 19:19:13 +0200184 \ "\%(^\|\W\)\zs\d*\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000185endif
186
Bram Moolenaar5c736222010-01-06 20:54:52 +0100187" Group the built-ins in the order in the 'Python Library Reference' for
188" easier comparison.
Bram Moolenaarf9132812015-07-21 19:19:13 +0200189" https://docs.python.org/2/library/constants.html
190" https://docs.python.org/3/library/constants.html
191" http://docs.python.org/2/library/functions.html
192" http://docs.python.org/3/library/functions.html
193" http://docs.python.org/2/library/functions.html#non-essential-built-in-functions
194" http://docs.python.org/3/library/functions.html#non-essential-built-in-functions
Bram Moolenaar5c736222010-01-06 20:54:52 +0100195" Python built-in functions are in alphabetical order.
196if !exists("python_no_builtin_highlight")
197 " built-in constants
Bram Moolenaarf9132812015-07-21 19:19:13 +0200198 " 'False', 'True', and 'None' are also reserved words in Python 3
Bram Moolenaar5c736222010-01-06 20:54:52 +0100199 syn keyword pythonBuiltin False True None
200 syn keyword pythonBuiltin NotImplemented Ellipsis __debug__
201 " built-in functions
Bram Moolenaarf9132812015-07-21 19:19:13 +0200202 syn keyword pythonBuiltin abs all any bin bool bytearray callable chr
203 syn keyword pythonBuiltin classmethod compile complex delattr dict dir
204 syn keyword pythonBuiltin divmod enumerate eval filter float format
Bram Moolenaar5c736222010-01-06 20:54:52 +0100205 syn keyword pythonBuiltin frozenset getattr globals hasattr hash
206 syn keyword pythonBuiltin help hex id input int isinstance
207 syn keyword pythonBuiltin issubclass iter len list locals map max
Bram Moolenaarf9132812015-07-21 19:19:13 +0200208 syn keyword pythonBuiltin memoryview min next object oct open ord pow
209 syn keyword pythonBuiltin print property range repr reversed round set
Bram Moolenaar5c736222010-01-06 20:54:52 +0100210 syn keyword pythonBuiltin setattr slice sorted staticmethod str
211 syn keyword pythonBuiltin sum super tuple type vars zip __import__
Bram Moolenaarf9132812015-07-21 19:19:13 +0200212 " Python 2 only
213 syn keyword pythonBuiltin basestring cmp execfile file
Bram Moolenaar5c736222010-01-06 20:54:52 +0100214 syn keyword pythonBuiltin long raw_input reduce reload unichr
215 syn keyword pythonBuiltin unicode xrange
Bram Moolenaarf9132812015-07-21 19:19:13 +0200216 " Python 3 only
217 syn keyword pythonBuiltin ascii bytes exec
218 " non-essential built-in functions; Python 2 only
Bram Moolenaar5c736222010-01-06 20:54:52 +0100219 syn keyword pythonBuiltin apply buffer coerce intern
Bram Moolenaar77cdfd12016-03-12 12:57:59 +0100220 " avoid highlighting attributes as builtins
Bram Moolenaarb4ada792016-10-30 21:55:26 +0100221 syn match pythonAttribute /\.\h\w*/hs=s+1
222 \ contains=ALLBUT,pythonBuiltin,pythonFunction,pythonAsync
223 \ transparent
Bram Moolenaar071d4272004-06-13 20:20:40 +0000224endif
225
Bram Moolenaar5c736222010-01-06 20:54:52 +0100226" From the 'Python Library Reference' class hierarchy at the bottom.
Bram Moolenaarf9132812015-07-21 19:19:13 +0200227" http://docs.python.org/2/library/exceptions.html
228" http://docs.python.org/3/library/exceptions.html
Bram Moolenaar5c736222010-01-06 20:54:52 +0100229if !exists("python_no_exception_highlight")
Bram Moolenaarf9132812015-07-21 19:19:13 +0200230 " builtin base exceptions (used mostly as base classes for other exceptions)
Bram Moolenaar5c736222010-01-06 20:54:52 +0100231 syn keyword pythonExceptions BaseException Exception
Bram Moolenaarf9132812015-07-21 19:19:13 +0200232 syn keyword pythonExceptions ArithmeticError BufferError
Bram Moolenaar5c736222010-01-06 20:54:52 +0100233 syn keyword pythonExceptions LookupError
Bram Moolenaarf9132812015-07-21 19:19:13 +0200234 " builtin base exceptions removed in Python 3
235 syn keyword pythonExceptions EnvironmentError StandardError
Bram Moolenaar5c736222010-01-06 20:54:52 +0100236 " builtin exceptions (actually raised)
Bram Moolenaarf9132812015-07-21 19:19:13 +0200237 syn keyword pythonExceptions AssertionError AttributeError
Bram Moolenaar5c736222010-01-06 20:54:52 +0100238 syn keyword pythonExceptions EOFError FloatingPointError GeneratorExit
Bram Moolenaarf9132812015-07-21 19:19:13 +0200239 syn keyword pythonExceptions ImportError IndentationError
Bram Moolenaar5c736222010-01-06 20:54:52 +0100240 syn keyword pythonExceptions IndexError KeyError KeyboardInterrupt
241 syn keyword pythonExceptions MemoryError NameError NotImplementedError
242 syn keyword pythonExceptions OSError OverflowError ReferenceError
243 syn keyword pythonExceptions RuntimeError StopIteration SyntaxError
244 syn keyword pythonExceptions SystemError SystemExit TabError TypeError
245 syn keyword pythonExceptions UnboundLocalError UnicodeError
246 syn keyword pythonExceptions UnicodeDecodeError UnicodeEncodeError
Bram Moolenaarf9132812015-07-21 19:19:13 +0200247 syn keyword pythonExceptions UnicodeTranslateError ValueError
248 syn keyword pythonExceptions ZeroDivisionError
249 " builtin OS exceptions in Python 3
250 syn keyword pythonExceptions BlockingIOError BrokenPipeError
251 syn keyword pythonExceptions ChildProcessError ConnectionAbortedError
252 syn keyword pythonExceptions ConnectionError ConnectionRefusedError
253 syn keyword pythonExceptions ConnectionResetError FileExistsError
254 syn keyword pythonExceptions FileNotFoundError InterruptedError
255 syn keyword pythonExceptions IsADirectoryError NotADirectoryError
256 syn keyword pythonExceptions PermissionError ProcessLookupError
Bram Moolenaarca635012015-09-25 20:34:21 +0200257 syn keyword pythonExceptions RecursionError StopAsyncIteration
Bram Moolenaarf9132812015-07-21 19:19:13 +0200258 syn keyword pythonExceptions TimeoutError
259 " builtin exceptions deprecated/removed in Python 3
260 syn keyword pythonExceptions IOError VMSError WindowsError
Bram Moolenaar5c736222010-01-06 20:54:52 +0100261 " builtin warnings
262 syn keyword pythonExceptions BytesWarning DeprecationWarning FutureWarning
263 syn keyword pythonExceptions ImportWarning PendingDeprecationWarning
264 syn keyword pythonExceptions RuntimeWarning SyntaxWarning UnicodeWarning
265 syn keyword pythonExceptions UserWarning Warning
Bram Moolenaarf9132812015-07-21 19:19:13 +0200266 " builtin warnings in Python 3
267 syn keyword pythonExceptions ResourceWarning
Bram Moolenaar071d4272004-06-13 20:20:40 +0000268endif
269
Bram Moolenaar5c736222010-01-06 20:54:52 +0100270if exists("python_space_error_highlight")
Bram Moolenaar071d4272004-06-13 20:20:40 +0000271 " trailing whitespace
Bram Moolenaar5c736222010-01-06 20:54:52 +0100272 syn match pythonSpaceError display excludenl "\s\+$"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000273 " mixed tabs and spaces
Bram Moolenaar5c736222010-01-06 20:54:52 +0100274 syn match pythonSpaceError display " \+\t"
275 syn match pythonSpaceError display "\t\+ "
Bram Moolenaar071d4272004-06-13 20:20:40 +0000276endif
277
Bram Moolenaar5c736222010-01-06 20:54:52 +0100278" Do not spell doctests inside strings.
279" Notice that the end of a string, either ''', or """, will end the contained
280" doctest too. Thus, we do *not* need to have it as an end pattern.
281if !exists("python_no_doctest_highlight")
Bram Moolenaar34700a62013-03-07 13:20:54 +0100282 if !exists("python_no_doctest_code_highlight")
Bram Moolenaar5c736222010-01-06 20:54:52 +0100283 syn region pythonDoctest
284 \ start="^\s*>>>\s" end="^\s*$"
Bram Moolenaarb4ada792016-10-30 21:55:26 +0100285 \ contained contains=ALLBUT,pythonDoctest,pythonFunction,@Spell
Bram Moolenaar5c736222010-01-06 20:54:52 +0100286 syn region pythonDoctestValue
287 \ start=+^\s*\%(>>>\s\|\.\.\.\s\|"""\|'''\)\@!\S\++ end="$"
288 \ contained
289 else
290 syn region pythonDoctest
291 \ start="^\s*>>>" end="^\s*$"
292 \ contained contains=@NoSpell
293 endif
294endif
295
296" Sync at the beginning of class, function, or method definition.
Bram Moolenaarb4ada792016-10-30 21:55:26 +0100297syn sync match pythonSync grouphere NONE "^\%(def\|class\)\s\+\h\w*\s*[(:]"
Bram Moolenaar071d4272004-06-13 20:20:40 +0000298
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200299" The default highlight links. Can be overridden later.
Bram Moolenaard0796902016-09-16 20:02:31 +0200300hi def link pythonStatement Statement
301hi def link pythonConditional Conditional
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200302hi def link pythonRepeat Repeat
303hi def link pythonOperator Operator
Bram Moolenaard0796902016-09-16 20:02:31 +0200304hi def link pythonException Exception
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200305hi def link pythonInclude Include
Bram Moolenaard0796902016-09-16 20:02:31 +0200306hi def link pythonAsync Statement
307hi def link pythonDecorator Define
308hi def link pythonDecoratorName Function
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200309hi def link pythonFunction Function
310hi def link pythonComment Comment
Bram Moolenaard0796902016-09-16 20:02:31 +0200311hi def link pythonTodo Todo
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200312hi def link pythonString String
Bram Moolenaard0796902016-09-16 20:02:31 +0200313hi def link pythonRawString String
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200314hi def link pythonQuotes String
Bram Moolenaard0796902016-09-16 20:02:31 +0200315hi def link pythonTripleQuotes pythonQuotes
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200316hi def link pythonEscape Special
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200317if !exists("python_no_number_highlight")
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200318 hi def link pythonNumber Number
Bram Moolenaar071d4272004-06-13 20:20:40 +0000319endif
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200320if !exists("python_no_builtin_highlight")
Bram Moolenaard0796902016-09-16 20:02:31 +0200321 hi def link pythonBuiltin Function
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200322endif
323if !exists("python_no_exception_highlight")
Bram Moolenaard0796902016-09-16 20:02:31 +0200324 hi def link pythonExceptions Structure
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200325endif
326if exists("python_space_error_highlight")
Bram Moolenaard0796902016-09-16 20:02:31 +0200327 hi def link pythonSpaceError Error
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200328endif
329if !exists("python_no_doctest_highlight")
Bram Moolenaard0796902016-09-16 20:02:31 +0200330 hi def link pythonDoctest Special
Bram Moolenaarf37506f2016-08-31 22:22:10 +0200331 hi def link pythonDoctestValue Define
Bram Moolenaar89bcfda2016-08-30 23:26:57 +0200332endif
333
Bram Moolenaar071d4272004-06-13 20:20:40 +0000334let b:current_syntax = "python"
335
Bram Moolenaar00659062010-09-21 22:34:02 +0200336let &cpo = s:cpo_save
337unlet s:cpo_save
338
Bram Moolenaar5c736222010-01-06 20:54:52 +0100339" vim:set sw=2 sts=2 ts=8 noet: