Files
neovim/runtime/syntax/python.vim
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

462 lines
19 KiB
VimL
Raw Normal View History

2014-07-11 04:05:51 +00:00
" Vim syntax file
" Language: Python
2016-02-02 23:03:53 -08:00
" Maintainer: Zvezdan Petkovic <zpetkovic@acm.org>
" Last Change: 2025 Sep 08
" 2025 Sep 25 by Vim Project: fix wrong type highlighting #18394
" 2025 Dec 03 by Vim Project: highlight t-strings #18679
" 2026 Jan 26 by Vim Project: highlight constants #18922
" 2026 Mar 11 by Vim Project: fix number performance #19630
2016-02-02 23:03:53 -08:00
" Credits: Neil Schemenauer <nas@python.ca>
2014-07-11 04:05:51 +00:00
" Dmitry Vasiliev
" Rob B
" Jon Parise
2014-07-11 04:05:51 +00:00
"
" This version is a major rewrite by Zvezdan Petkovic.
"
" - introduced highlighting of doctests
" - updated keywords, built-ins, and exceptions
" - corrected regular expressions for
"
" * functions
" * decorators
" * strings
" * escapes
" * numbers
" * space error
"
" - corrected synchronization
" - more highlighting is ON by default, except
" - space error highlighting is OFF by default
"
" Optional highlighting can be controlled using these variables.
"
" let python_no_builtin_highlight = 1
" let python_no_doctest_code_highlight = 1
" let python_no_doctest_highlight = 1
" let python_no_exception_highlight = 1
" let python_no_number_highlight = 1
" let python_space_error_highlight = 1
" let python_constant_highlight = 1
2014-07-11 04:05:51 +00:00
"
" All the options above can be switched on together.
"
" let python_highlight_all = 1
"
2023-02-28 09:34:27 +01:00
" The use of Python 2 compatible syntax highlighting can be enforced.
" The straddling code (Python 2 and 3 compatible), up to Python 3.5,
" will be also supported.
"
" let python_use_python2_syntax = 1
"
" This option will exclude all modern Python 3.6 or higher features.
"
2014-07-11 04:05:51 +00:00
2017-04-28 21:06:44 +02:00
" quit when a syntax file was already loaded.
if exists("b:current_syntax")
2014-07-11 04:05:51 +00:00
finish
endif
2023-02-28 09:34:27 +01:00
" Use of Python 2 and 3.5 or lower requested.
if exists("python_use_python2_syntax")
runtime! syntax/python2.vim
finish
endif
2014-07-11 04:05:51 +00:00
" We need nocompatible mode in order to continue lines with backslashes.
" Original setting will be restored.
let s:cpo_save = &cpo
set cpo&vim
2017-04-29 01:50:00 +02:00
if exists("python_no_doctest_highlight")
let python_no_doctest_code_highlight = 1
endif
if exists("python_highlight_all")
if exists("python_no_builtin_highlight")
unlet python_no_builtin_highlight
endif
if exists("python_no_doctest_code_highlight")
unlet python_no_doctest_code_highlight
endif
if exists("python_no_doctest_highlight")
unlet python_no_doctest_highlight
endif
if exists("python_no_exception_highlight")
unlet python_no_exception_highlight
endif
if exists("python_no_number_highlight")
unlet python_no_number_highlight
endif
let python_space_error_highlight = 1
let python_constant_highlight = 1
2017-04-29 01:50:00 +02:00
endif
2014-07-11 04:05:51 +00:00
" Keep Python keywords in alphabetical order inside groups for easy
" comparison with the table in the 'Python Language Reference'
2021-05-02 10:19:25 -04:00
" https://docs.python.org/reference/lexical_analysis.html#keywords.
2014-07-11 04:05:51 +00:00
" Groups are in the order presented in NAMING CONVENTIONS in syntax.txt.
" Exceptions come last at the end of each group (class and def below).
"
2021-05-02 10:19:25 -04:00
" The list can be checked using:
2014-07-11 04:05:51 +00:00
"
2021-12-16 21:46:13 +01:00
" python3 -c 'import keyword, pprint; pprint.pprint(keyword.kwlist + keyword.softkwlist, compact=True)'
2014-07-11 04:05:51 +00:00
"
syn keyword pythonBoolean False True
syn keyword pythonConstant None
2021-05-02 10:19:25 -04:00
syn keyword pythonStatement as assert break continue del global
syn keyword pythonStatement lambda nonlocal pass return with yield
syn keyword pythonStatement class nextgroup=pythonClass skipwhite
syn keyword pythonStatement def nextgroup=pythonFunction skipwhite
2014-07-11 04:05:51 +00:00
syn keyword pythonConditional elif else if
syn keyword pythonRepeat for while
syn keyword pythonOperator and in is not or
syn keyword pythonException except finally raise try
syn keyword pythonInclude from import
2016-04-18 09:15:13 -07:00
syn keyword pythonAsync async await
2014-07-11 04:05:51 +00:00
2022-07-30 15:48:32 +02:00
" Soft keywords
2023-02-28 09:34:27 +01:00
" These keywords do not mean anything unless used in the right context.
" See https://docs.python.org/3/reference/lexical_analysis.html#soft-keywords
2022-07-30 15:48:32 +02:00
" for more on this.
syn match pythonConditional "^\s*\zscase\%(\s\+.*:.*$\)\@="
syn match pythonConditional "^\s*\zsmatch\%(\s\+.*:\s*\%(#.*\)\=$\)\@="
syn match pythonStatement "\<type\ze\s\+\h\w*" nextgroup=pythonType skipwhite
2022-07-30 15:48:32 +02:00
" These names are special by convention. While they aren't real keywords,
" giving them distinct highlighting provides a nice visual cue.
syn keyword pythonClassVar self cls
2021-05-02 10:19:25 -04:00
" Decorators
2014-07-11 04:05:51 +00:00
" A dot must be allowed because of @MyClass.myfunc decorators.
2017-04-29 01:50:00 +02:00
syn match pythonDecorator "@" display contained
syn match pythonDecoratorName "@\s*\h\%(\w\|\.\)*" display contains=pythonDecorator
" Python 3.5 introduced the use of the same symbol for matrix multiplication:
" https://www.python.org/dev/peps/pep-0465/. We now have to exclude the
" symbol from highlighting when used in that context.
" Single line multiplication.
syn match pythonMatrixMultiply
\ "\%(\w\|[])]\)\s*@"
\ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonClass,pythonFunction,pythonType,pythonDoctestValue
2017-04-29 01:50:00 +02:00
\ transparent
" Multiplication continued on the next line after backslash.
syn match pythonMatrixMultiply
\ "[^\\]\\\s*\n\%(\s*\.\.\.\s\)\=\s\+@"
\ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonClass,pythonFunction,pythonType,pythonDoctestValue
2017-04-29 01:50:00 +02:00
\ transparent
" Multiplication in a parenthesized expression over multiple lines with @ at
" the start of each continued line; very similar to decorators and complex.
syn match pythonMatrixMultiply
\ "^\s*\%(\%(>>>\|\.\.\.\)\s\+\)\=\zs\%(\h\|\%(\h\|[[(]\).\{-}\%(\w\|[])]\)\)\s*\n\%(\s*\.\.\.\s\)\=\s\+@\%(.\{-}\n\%(\s*\.\.\.\s\)\=\s\+@\)*"
\ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonClass,pythonFunction,pythonType,pythonDoctestValue
2017-04-29 01:50:00 +02:00
\ transparent
2017-04-16 17:42:41 +02:00
syn match pythonClass "\h\w*" display contained
2017-04-29 01:50:00 +02:00
syn match pythonFunction "\h\w*" display contained
syn match pythonType "\h\w*" display contained
2014-07-11 04:05:51 +00:00
syn match pythonComment "#.*$" contains=pythonTodo,@Spell
syn keyword pythonTodo FIXME NOTE NOTES TODO XXX contained
" Triple-quoted strings can contain doctests.
2016-02-02 23:03:53 -08:00
syn region pythonString matchgroup=pythonQuotes
2014-07-11 04:05:51 +00:00
\ start=+[uU]\=\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
\ contains=pythonEscape,pythonUnicodeEscape,@Spell
2016-02-02 23:03:53 -08:00
syn region pythonString matchgroup=pythonTripleQuotes
2015-08-11 10:07:18 +02:00
\ start=+[uU]\=\z('''\|"""\)+ skip=+\\["']+ end="\z1" keepend
\ contains=pythonEscape,pythonUnicodeEscape,pythonSpaceError,pythonDoctest,@Spell
2016-02-02 23:03:53 -08:00
syn region pythonRawString matchgroup=pythonQuotes
\ start=+[rR]\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
2014-07-11 04:05:51 +00:00
\ contains=@Spell
2016-02-02 23:03:53 -08:00
syn region pythonRawString matchgroup=pythonTripleQuotes
\ start=+[rR]\z('''\|"""\)+ end="\z1" keepend
2014-07-11 04:05:51 +00:00
\ contains=pythonSpaceError,pythonDoctest,@Spell
" Formatted string literals (f-strings)
" https://docs.python.org/3/reference/lexical_analysis.html#f-strings
" Template string literals (t-strings)
" https://docs.python.org/3/reference/lexical_analysis.html#template-string-literals
syn region pythonFString
\ matchgroup=pythonQuotes
\ start=+\c[FT]\z(['"]\)+
\ end="\z1"
\ skip="\\\\\|\\\z1"
\ contains=pythonFStringField,pythonFStringSkip,pythonEscape,pythonUnicodeEscape,@Spell
syn region pythonFString
\ matchgroup=pythonTripleQuotes
\ start=+\c[FT]\z('''\|"""\)+
\ end="\z1"
\ keepend
\ contains=pythonFStringField,pythonFStringSkip,pythonEscape,pythonUnicodeEscape,pythonSpaceError,pythonDoctest,@Spell
syn region pythonRawFString
\ matchgroup=pythonQuotes
\ start=+\c\%([FT]R\|R[FT]\)\z(['"]\)+
\ end="\z1"
\ skip="\\\\\|\\\z1"
\ contains=pythonFStringField,pythonFStringSkip,@Spell
syn region pythonRawFString
\ matchgroup=pythonTripleQuotes
\ start=+\c\%([FT]R\|R[FT]\)\z('''\|"""\)+
\ end="\z1"
\ keepend
\ contains=pythonFStringField,pythonFStringSkip,pythonSpaceError,pythonDoctest,@Spell
" Bytes
syn region pythonBytes
\ matchgroup=pythonQuotes
\ start=+\cB\z(['"]\)+
\ end="\z1"
\ skip="\\\\\|\\\z1"
\ contains=pythonEscape
syn region pythonBytes
\ matchgroup=pythonTripleQuotes
\ start=+\cB\z('''\|"""\)+
\ end="\z1"
\ keepend
\ contains=pythonEscape
syn region pythonRawBytes
\ matchgroup=pythonQuotes
\ start=+\c\%(BR\|RB\)\z(['"]\)+
\ end="\z1"
\ skip="\\\\\|\\\z1"
syn region pythonRawBytes
\ matchgroup=pythonTripleQuotes
\ start=+\c\%(BR\|RB\)\z('''\|"""\)+
\ end="\z1"
\ keepend
" F-string replacement fields
"
" - Matched parentheses, brackets and braces are skipped
" - A bare = (followed by optional whitespace) enables debugging
" - A bare ! prefixes a conversion field (followed by optional whitespace)
" - A bare : begins a format specification
" - Matched braces inside a format specification are skipped
"
syn region pythonFStringField
\ matchgroup=pythonFStringDelimiter
\ start=/{/
\ end=/\%(=\s*\)\=\%(!\a\s*\)\=\%(:\%({\_[^}]*}\|[^{}]*\)\+\)\=}/
\ contained
\ contains=ALLBUT,pythonFStringField,pythonClass,pythonFunction,pythonType,pythonDoctest,pythonDoctestValue,@Spell
syn match pythonFStringFieldSkip /(\_[^()]*)\|\[\_[^][]*]\|{\_[^{}]*}/
\ contained
\ contains=ALLBUT,pythonFStringField,pythonClass,pythonFunction,pythonType,pythonDoctest,pythonDoctestValue,@Spell
" Doubled braces are not replacement fields
syn match pythonFStringSkip /{{/ transparent contained contains=NONE
2014-07-11 04:05:51 +00:00
syn match pythonEscape +\\[abfnrtv'"\\]+ contained
syn match pythonEscape "\\\o\{1,3}" contained
syn match pythonEscape "\\x\x\{2}" contained
syn match pythonUnicodeEscape "\%(\\u\x\{4}\|\\U\x\{8}\)" contained
2014-07-11 04:05:51 +00:00
" Python allows case-insensitive Unicode IDs: http://www.unicode.org/charts/
" The specification: https://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-4/#G135165
syn match pythonUnicodeEscape "\\N{\a\+\%(\%(\s\a\+[[:alnum:]]*\)\|\%(-[[:alnum:]]\+\)\)*}" contained
2014-07-11 04:05:51 +00:00
syn match pythonEscape "\\$"
" It is very important to understand all details before changing the
" regular expressions below or their order.
" The word boundaries are *not* the floating-point number boundaries
" because of a possible leading or trailing decimal point.
" The expressions below ensure that all valid number literals are
" highlighted, and invalid number literals are not. For example,
"
" - a decimal point in '4.' at the end of a line is highlighted,
" - a second dot in 1.0.0 is not highlighted,
" - 08 is not highlighted,
" - 08e0 or 08j are highlighted,
"
" and so on, as specified in the 'Python Language Reference'.
2021-05-02 10:19:25 -04:00
" https://docs.python.org/reference/lexical_analysis.html#numeric-literals
2014-07-11 04:05:51 +00:00
if !exists("python_no_number_highlight")
2023-04-23 15:22:55 +02:00
" numbers (including complex)
syn match pythonNumber "\<0[oO]_\=\o\+\%(_\o\+\)*\>"
syn match pythonNumber "\<0[xX]_\=\x\+\%(_\x\+\)*\>"
syn match pythonNumber "\<0[bB]_\=[01]\+\%(_[01]\+\)*\>"
syn match pythonNumber "\<\%([1-9]\d*\%(_\d\+\)*\|0\+\%(_0\+\)*\)\>"
syn match pythonNumber "\<\d\+\%(_\d\+\)*[jJ]\>"
syn match pythonNumber "\<\d\+\%(_\d\+\)*[eE][+-]\=\d\+\%(_\d\+\)*[jJ]\=\>"
" \d\.
2014-07-11 04:05:51 +00:00
syn match pythonNumber
\ "\<\d\+\%(_\d\+\)*\.\%([eE][+-]\=\d\+\%(_\d\+\)*\)\=[jJ]\=\%(\W\|$\)\@="
" \d\.\d
2014-07-11 04:05:51 +00:00
syn match pythonNumber
\ "\<\d\+\%(_\d\+\)*\.\d\+\%(_\d\+\)*\%([eE][+-]\=\d\+\%(_\d\+\)*\)\=[jJ]\=\>"
" \.\d
syn match pythonNumber
\ "\%(^\|\W\)\@1<=\.\d\+\%(_\d\+\)*\%([eE][+-]\=\d\+\%(_\d\+\)*\)\=[jJ]\=\>"
2014-07-11 04:05:51 +00:00
endif
" Group the built-ins in the order in the 'Python Library Reference' for
" easier comparison.
2021-05-02 10:19:25 -04:00
" https://docs.python.org/library/constants.html
" http://docs.python.org/library/functions.html
2014-07-11 04:05:51 +00:00
" Python built-in functions are in alphabetical order.
2021-05-02 10:19:25 -04:00
"
" The list can be checked using:
"
" python3 -c 'import builtins, pprint; pprint.pprint(dir(builtins), compact=True)'
"
" The constants added by the `site` module are not listed below because they
" should not be used in programs, only in interactive interpreter.
" Similarly for some other attributes and functions `__`-enclosed from the
" output of the above command.
"
2014-07-11 04:05:51 +00:00
if !exists("python_no_builtin_highlight")
" built-in constants
2016-03-04 08:18:26 +09:00
" 'False', 'True', and 'None' are also reserved words in Python 3
syn keyword pythonBoolean False True
syn keyword pythonConstant None NotImplemented Ellipsis __debug__
2021-05-02 10:19:25 -04:00
" constants added by the `site` module
syn keyword pythonBuiltin quit exit copyright credits license
2014-07-11 04:05:51 +00:00
" built-in functions
2021-05-02 10:19:25 -04:00
syn keyword pythonBuiltin abs all any ascii bin bool breakpoint bytearray
syn keyword pythonBuiltin bytes callable chr classmethod compile complex
syn keyword pythonBuiltin delattr dict dir divmod enumerate eval exec
syn keyword pythonBuiltin filter float format frozenset getattr globals
syn keyword pythonBuiltin hasattr hash help hex id input int isinstance
2014-07-11 04:05:51 +00:00
syn keyword pythonBuiltin issubclass iter len list locals map max
2016-03-04 08:18:26 +09:00
syn keyword pythonBuiltin memoryview min next object oct open ord pow
syn keyword pythonBuiltin print property range repr reversed round set
2021-05-02 10:19:25 -04:00
syn keyword pythonBuiltin setattr slice sorted staticmethod str sum super
syn keyword pythonBuiltin tuple vars zip __import__
" only match `type` as a builtin when it's not followed by an identifier
syn match pythonBuiltin "\<type\>\ze\(\s\+\h\w*\)\@!"
2016-06-20 10:37:19 -04:00
" avoid highlighting attributes as builtins
2017-04-29 01:50:00 +02:00
syn match pythonAttribute /\.\h\w*/hs=s+1
\ contains=ALLBUT,pythonBuiltin,pythonClass,pythonFunction,pythonType,pythonAsync
2017-04-29 01:50:00 +02:00
\ transparent
" the ellipsis literal `...` can be used in multiple syntactic contexts
syn match pythonEllipsis "\.\@1<!\.\.\.\ze\.\@!" display
2014-07-11 04:05:51 +00:00
endif
" From the 'Python Library Reference' class hierarchy at the bottom.
2021-05-02 10:19:25 -04:00
" http://docs.python.org/library/exceptions.html
2014-07-11 04:05:51 +00:00
if !exists("python_no_exception_highlight")
2016-03-04 08:18:26 +09:00
" builtin base exceptions (used mostly as base classes for other exceptions)
2014-07-11 04:05:51 +00:00
syn keyword pythonExceptions BaseException Exception
2021-05-02 10:19:25 -04:00
syn keyword pythonExceptions ArithmeticError BufferError LookupError
2014-07-11 04:05:51 +00:00
" builtin exceptions (actually raised)
2021-05-02 10:19:25 -04:00
syn keyword pythonExceptions AssertionError AttributeError EOFError
syn keyword pythonExceptions FloatingPointError GeneratorExit ImportError
syn keyword pythonExceptions IndentationError IndexError KeyError
syn keyword pythonExceptions KeyboardInterrupt MemoryError
syn keyword pythonExceptions ModuleNotFoundError NameError
syn keyword pythonExceptions NotImplementedError OSError OverflowError
syn keyword pythonExceptions RecursionError ReferenceError RuntimeError
syn keyword pythonExceptions StopAsyncIteration StopIteration SyntaxError
2014-07-11 04:05:51 +00:00
syn keyword pythonExceptions SystemError SystemExit TabError TypeError
2021-05-02 10:19:25 -04:00
syn keyword pythonExceptions UnboundLocalError UnicodeDecodeError
syn keyword pythonExceptions UnicodeEncodeError UnicodeError
2016-03-04 08:18:26 +09:00
syn keyword pythonExceptions UnicodeTranslateError ValueError
syn keyword pythonExceptions ZeroDivisionError
2021-05-02 10:19:25 -04:00
" builtin exception aliases for OSError
syn keyword pythonExceptions EnvironmentError IOError WindowsError
2016-03-04 08:18:26 +09:00
" builtin OS exceptions in Python 3
syn keyword pythonExceptions BlockingIOError BrokenPipeError
syn keyword pythonExceptions ChildProcessError ConnectionAbortedError
syn keyword pythonExceptions ConnectionError ConnectionRefusedError
syn keyword pythonExceptions ConnectionResetError FileExistsError
syn keyword pythonExceptions FileNotFoundError InterruptedError
syn keyword pythonExceptions IsADirectoryError NotADirectoryError
2021-05-02 10:19:25 -04:00
syn keyword pythonExceptions PermissionError ProcessLookupError TimeoutError
2014-07-11 04:05:51 +00:00
" builtin warnings
syn keyword pythonExceptions BytesWarning DeprecationWarning FutureWarning
syn keyword pythonExceptions ImportWarning PendingDeprecationWarning
2021-05-02 10:19:25 -04:00
syn keyword pythonExceptions ResourceWarning RuntimeWarning
syn keyword pythonExceptions SyntaxWarning UnicodeWarning
2014-07-11 04:05:51 +00:00
syn keyword pythonExceptions UserWarning Warning
endif
if exists("python_space_error_highlight")
" trailing whitespace
syn match pythonSpaceError display excludenl "\s\+$"
" mixed tabs and spaces
syn match pythonSpaceError display " \+\t"
syn match pythonSpaceError display "\t\+ "
endif
" Do not spell doctests inside strings.
" Notice that the end of a string, either ''', or """, will end the contained
" doctest too. Thus, we do *not* need to have it as an end pattern.
if !exists("python_no_doctest_highlight")
if !exists("python_no_doctest_code_highlight")
syn region pythonDoctest
\ start="^\s*>>>\s" end="^\s*$"
\ contained contains=ALLBUT,pythonDoctest,pythonEllipsis,pythonClass,pythonFunction,pythonType,@Spell
2014-07-11 04:05:51 +00:00
syn region pythonDoctestValue
\ start=+^\s*\%(>>>\s\|\.\.\.\s\|"""\|'''\)\@!\S\++ end="$"
\ contained contains=pythonEllipsis
syn match pythonEllipsis "\%(^\s*\)\@<!\.\@1<!\zs\.\.\.\ze\.\@!" display
\ contained containedin=pythonDoctest
2014-07-11 04:05:51 +00:00
else
syn region pythonDoctest
\ start="^\s*>>>" end="^\s*$"
\ contained contains=@NoSpell
endif
endif
" Sync at the beginning of (async) function or class definitions.
syn sync match pythonSync grouphere NONE "^\%(def\|class\|async\s\+def\)\s\+\h\w*\s*[(:]"
2014-07-11 04:05:51 +00:00
2017-04-28 21:06:44 +02:00
" The default highlight links. Can be overridden later.
hi def link pythonBoolean Statement
hi def link pythonConstant Statement
2017-04-28 22:47:40 +02:00
hi def link pythonStatement Statement
hi def link pythonConditional Conditional
2017-04-28 21:14:34 +02:00
hi def link pythonRepeat Repeat
hi def link pythonOperator Operator
2017-04-28 22:47:40 +02:00
hi def link pythonException Exception
2017-04-28 21:14:34 +02:00
hi def link pythonInclude Include
2017-04-28 22:47:40 +02:00
hi def link pythonAsync Statement
hi def link pythonClassVar Identifier
2017-04-28 22:47:40 +02:00
hi def link pythonDecorator Define
hi def link pythonDecoratorName Function
hi def link pythonClass Structure
2017-04-28 21:14:34 +02:00
hi def link pythonFunction Function
hi def link pythonType Type
2017-04-28 21:14:34 +02:00
hi def link pythonComment Comment
2017-04-28 22:47:40 +02:00
hi def link pythonTodo Todo
2017-04-28 21:14:34 +02:00
hi def link pythonString String
2017-04-28 22:47:40 +02:00
hi def link pythonRawString String
hi def link pythonFString String
hi def link pythonRawFString String
hi def link pythonBytes String
hi def link pythonRawBytes String
2017-04-28 21:14:34 +02:00
hi def link pythonQuotes String
2017-04-28 22:47:40 +02:00
hi def link pythonTripleQuotes pythonQuotes
2017-04-28 21:14:34 +02:00
hi def link pythonEscape Special
hi def link pythonUnicodeEscape pythonEscape
hi def link pythonFStringDelimiter Special
2017-04-28 21:06:44 +02:00
if !exists("python_no_number_highlight")
2017-04-28 21:14:34 +02:00
hi def link pythonNumber Number
2014-07-11 04:05:51 +00:00
endif
2017-04-28 21:06:44 +02:00
if !exists("python_no_builtin_highlight")
hi! def link pythonBoolean Function
hi! def link pythonConstant Function
2017-04-28 22:47:40 +02:00
hi def link pythonBuiltin Function
hi def link pythonEllipsis pythonBuiltin
2017-04-28 21:06:44 +02:00
endif
if !exists("python_no_exception_highlight")
2017-04-28 22:47:40 +02:00
hi def link pythonExceptions Structure
2017-04-28 21:06:44 +02:00
endif
if exists("python_space_error_highlight")
2017-04-28 22:47:40 +02:00
hi def link pythonSpaceError Error
2017-04-28 21:06:44 +02:00
endif
if !exists("python_no_doctest_highlight")
2017-04-28 22:47:40 +02:00
hi def link pythonDoctest Special
2017-04-28 21:14:34 +02:00
hi def link pythonDoctestValue Define
2017-04-28 21:06:44 +02:00
endif
if exists("python_constant_highlight")
hi! def link pythonBoolean Boolean
hi! def link pythonConstant Constant
endif
2017-04-28 21:06:44 +02:00
2014-07-11 04:05:51 +00:00
let b:current_syntax = "python"
let &cpo = s:cpo_save
unlet s:cpo_save
" vim:set sw=2 sts=2 ts=8 noet: