annotate runtime/syntax/python.vim @ 9394:bea9958b35a9

Added tag v7.4.1978 for changeset c4aae9421aecc06c8cc51edfc26ef083a84e690b
author Christian Brabandt <cb@256bit.org>
date Fri, 01 Jul 2016 22:00:07 +0200
parents da01d5da2cfa
children 9f7bcc2c3b97
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Python
6840
37828f7503c7 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
3 " Maintainer: Zvezdan Petkovic <zpetkovic@acm.org>
8497
da01d5da2cfa commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents: 7147
diff changeset
4 " Last Change: 2016 Feb 20
6840
37828f7503c7 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
5 " Credits: Neil Schemenauer <nas@python.ca>
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
6 " Dmitry Vasiliev
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 "
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
8 " This version is a major rewrite by Zvezdan Petkovic.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 "
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
10 " - introduced highlighting of doctests
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
11 " - updated keywords, built-ins, and exceptions
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
12 " - corrected regular expressions for
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 "
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
14 " * functions
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
15 " * decorators
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
16 " * strings
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
17 " * escapes
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
18 " * numbers
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
19 " * space error
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 "
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
21 " - corrected synchronization
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
22 " - more highlighting is ON by default, except
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
23 " - space error highlighting is OFF by default
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 "
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
25 " Optional highlighting can be controlled using these variables.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 "
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
27 " let python_no_builtin_highlight = 1
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
28 " let python_no_doctest_code_highlight = 1
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
29 " let python_no_doctest_highlight = 1
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
30 " let python_no_exception_highlight = 1
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
31 " let python_no_number_highlight = 1
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
32 " let python_space_error_highlight = 1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 "
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
34 " All the options above can be switched on together.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
35 "
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
36 " let python_highlight_all = 1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
39 " For version 5.x: Clear all syntax items.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
40 " For version 6.x: Quit when a syntax file was already loaded.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
2587
d0049ff5969e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
47 " We need nocompatible mode in order to continue lines with backslashes.
d0049ff5969e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
48 " Original setting will be restored.
d0049ff5969e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
49 let s:cpo_save = &cpo
d0049ff5969e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
50 set cpo&vim
d0049ff5969e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
51
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
52 " Keep Python keywords in alphabetical order inside groups for easy
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
53 " comparison with the table in the 'Python Language Reference'
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
54 " https://docs.python.org/2/reference/lexical_analysis.html#keywords,
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
55 " https://docs.python.org/3/reference/lexical_analysis.html#keywords.
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
56 " Groups are in the order presented in NAMING CONVENTIONS in syntax.txt.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
57 " Exceptions come last at the end of each group (class and def below).
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
58 "
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
59 " Keywords 'with' and 'as' are new in Python 2.6
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
60 " (use 'from __future__ import with_statement' in Python 2.5).
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
61 "
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
62 " Some compromises had to be made to support both Python 3 and 2.
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
63 " We include Python 3 features, but when a definition is duplicated,
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
64 " the last definition takes precedence.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
65 "
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
66 " - 'False', 'None', and 'True' are keywords in Python 3 but they are
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
67 " built-ins in 2 and will be highlighted as built-ins below.
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
68 " - 'exec' is a built-in in Python 3 and will be highlighted as
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
69 " built-in below.
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
70 " - 'nonlocal' is a keyword in Python 3 and will be highlighted.
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
71 " - 'print' is a built-in in Python 3 and will be highlighted as
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
72 " built-in below (use 'from __future__ import print_function' in 2)
7147
c590de398af9 commit https://github.com/vim/vim/commit/ca63501fbcd1cf9c8aa9ff12c093c95b62a89ed7
Christian Brabandt <cb@256bit.org>
parents: 6951
diff changeset
73 " - async and await were added in Python 3.5 and are soft keywords.
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
74 "
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
75 syn keyword pythonStatement False, None, True
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
76 syn keyword pythonStatement as assert break continue del exec global
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
77 syn keyword pythonStatement lambda nonlocal pass print return with yield
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
78 syn keyword pythonStatement class def nextgroup=pythonFunction skipwhite
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
79 syn keyword pythonConditional elif else if
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 syn keyword pythonRepeat for while
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 syn keyword pythonOperator and in is not or
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
82 syn keyword pythonException except finally raise try
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
83 syn keyword pythonInclude from import
7147
c590de398af9 commit https://github.com/vim/vim/commit/ca63501fbcd1cf9c8aa9ff12c093c95b62a89ed7
Christian Brabandt <cb@256bit.org>
parents: 6951
diff changeset
84 syn keyword pythonAsync async await
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
859
99305c4c42d4 updated for version 7.0g02
vimboss
parents: 818
diff changeset
86 " Decorators (new in Python 2.4)
99305c4c42d4 updated for version 7.0g02
vimboss
parents: 818
diff changeset
87 syn match pythonDecorator "@" display nextgroup=pythonFunction skipwhite
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
88 " The zero-length non-grouping match before the function name is
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
89 " extremely important in pythonFunction. Without it, everything is
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
90 " interpreted as a function inside the contained environment of
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
91 " doctests.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
92 " A dot must be allowed because of @MyClass.myfunc decorators.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
93 syn match pythonFunction
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
94 \ "\%(\%(def\s\|class\s\|@\)\s*\)\@<=\h\%(\w\|\.\)*" contained
859
99305c4c42d4 updated for version 7.0g02
vimboss
parents: 818
diff changeset
95
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
96 syn match pythonComment "#.*$" contains=pythonTodo,@Spell
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
97 syn keyword pythonTodo FIXME NOTE NOTES TODO XXX contained
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
98
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
99 " Triple-quoted strings can contain doctests.
6840
37828f7503c7 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
100 syn region pythonString matchgroup=pythonQuotes
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
101 \ start=+[uU]\=\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
102 \ contains=pythonEscape,@Spell
6840
37828f7503c7 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
103 syn region pythonString matchgroup=pythonTripleQuotes
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
104 \ start=+[uU]\=\z('''\|"""\)+ end="\z1" keepend
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
105 \ contains=pythonEscape,pythonSpaceError,pythonDoctest,@Spell
6840
37828f7503c7 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
106 syn region pythonRawString matchgroup=pythonQuotes
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
107 \ start=+[uU]\=[rR]\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
108 \ contains=@Spell
6840
37828f7503c7 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
109 syn region pythonRawString matchgroup=pythonTripleQuotes
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
110 \ start=+[uU]\=[rR]\z('''\|"""\)+ end="\z1" keepend
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
111 \ contains=pythonSpaceError,pythonDoctest,@Spell
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
112
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
113 syn match pythonEscape +\\[abfnrtv'"\\]+ contained
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
114 syn match pythonEscape "\\\o\{1,3}" contained
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
115 syn match pythonEscape "\\x\x\{2}" contained
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
116 syn match pythonEscape "\%(\\u\x\{4}\|\\U\x\{8}\)" contained
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
117 " Python allows case-insensitive Unicode IDs: http://www.unicode.org/charts/
6840
37828f7503c7 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
118 syn match pythonEscape "\\N{\a\+\%(\s\a\+\)*}" contained
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
119 syn match pythonEscape "\\$"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 if exists("python_highlight_all")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
122 if exists("python_no_builtin_highlight")
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
123 unlet python_no_builtin_highlight
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
124 endif
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
125 if exists("python_no_doctest_code_highlight")
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
126 unlet python_no_doctest_code_highlight
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
127 endif
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
128 if exists("python_no_doctest_highlight")
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
129 unlet python_no_doctest_highlight
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
130 endif
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
131 if exists("python_no_exception_highlight")
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
132 unlet python_no_exception_highlight
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
133 endif
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
134 if exists("python_no_number_highlight")
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
135 unlet python_no_number_highlight
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
136 endif
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
137 let python_space_error_highlight = 1
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
138 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
140 " It is very important to understand all details before changing the
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
141 " regular expressions below or their order.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
142 " The word boundaries are *not* the floating-point number boundaries
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
143 " because of a possible leading or trailing decimal point.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
144 " The expressions below ensure that all valid number literals are
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
145 " highlighted, and invalid number literals are not. For example,
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
146 "
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
147 " - a decimal point in '4.' at the end of a line is highlighted,
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
148 " - a second dot in 1.0.0 is not highlighted,
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
149 " - 08 is not highlighted,
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
150 " - 08e0 or 08j are highlighted,
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
151 "
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
152 " and so on, as specified in the 'Python Language Reference'.
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
153 " https://docs.python.org/2/reference/lexical_analysis.html#numeric-literals
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
154 " https://docs.python.org/3/reference/lexical_analysis.html#numeric-literals
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
155 if !exists("python_no_number_highlight")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 " numbers (including longs and complex)
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
157 syn match pythonNumber "\<0[oO]\=\o\+[Ll]\=\>"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
158 syn match pythonNumber "\<0[xX]\x\+[Ll]\=\>"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
159 syn match pythonNumber "\<0[bB][01]\+[Ll]\=\>"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
160 syn match pythonNumber "\<\%([1-9]\d*\|0\)[Ll]\=\>"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
161 syn match pythonNumber "\<\d\+[jJ]\>"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
162 syn match pythonNumber "\<\d\+[eE][+-]\=\d\+[jJ]\=\>"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
163 syn match pythonNumber
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
164 \ "\<\d\+\.\%([eE][+-]\=\d\+\)\=[jJ]\=\%(\W\|$\)\@="
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
165 syn match pythonNumber
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
166 \ "\%(^\|\W\)\zs\d*\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
169 " Group the built-ins in the order in the 'Python Library Reference' for
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
170 " easier comparison.
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
171 " https://docs.python.org/2/library/constants.html
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
172 " https://docs.python.org/3/library/constants.html
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
173 " http://docs.python.org/2/library/functions.html
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
174 " http://docs.python.org/3/library/functions.html
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
175 " http://docs.python.org/2/library/functions.html#non-essential-built-in-functions
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
176 " http://docs.python.org/3/library/functions.html#non-essential-built-in-functions
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
177 " Python built-in functions are in alphabetical order.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
178 if !exists("python_no_builtin_highlight")
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
179 " built-in constants
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
180 " 'False', 'True', and 'None' are also reserved words in Python 3
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
181 syn keyword pythonBuiltin False True None
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
182 syn keyword pythonBuiltin NotImplemented Ellipsis __debug__
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
183 " built-in functions
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
184 syn keyword pythonBuiltin abs all any bin bool bytearray callable chr
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
185 syn keyword pythonBuiltin classmethod compile complex delattr dict dir
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
186 syn keyword pythonBuiltin divmod enumerate eval filter float format
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
187 syn keyword pythonBuiltin frozenset getattr globals hasattr hash
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
188 syn keyword pythonBuiltin help hex id input int isinstance
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
189 syn keyword pythonBuiltin issubclass iter len list locals map max
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
190 syn keyword pythonBuiltin memoryview min next object oct open ord pow
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
191 syn keyword pythonBuiltin print property range repr reversed round set
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
192 syn keyword pythonBuiltin setattr slice sorted staticmethod str
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
193 syn keyword pythonBuiltin sum super tuple type vars zip __import__
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
194 " Python 2 only
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
195 syn keyword pythonBuiltin basestring cmp execfile file
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
196 syn keyword pythonBuiltin long raw_input reduce reload unichr
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
197 syn keyword pythonBuiltin unicode xrange
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
198 " Python 3 only
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
199 syn keyword pythonBuiltin ascii bytes exec
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
200 " non-essential built-in functions; Python 2 only
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
201 syn keyword pythonBuiltin apply buffer coerce intern
8497
da01d5da2cfa commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents: 7147
diff changeset
202 " avoid highlighting attributes as builtins
da01d5da2cfa commit https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151
Christian Brabandt <cb@256bit.org>
parents: 7147
diff changeset
203 syn match pythonAttribute /\.\h\w*/hs=s+1 contains=ALLBUT,pythonBuiltin transparent
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
206 " From the 'Python Library Reference' class hierarchy at the bottom.
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
207 " http://docs.python.org/2/library/exceptions.html
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
208 " http://docs.python.org/3/library/exceptions.html
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
209 if !exists("python_no_exception_highlight")
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
210 " builtin base exceptions (used mostly as base classes for other exceptions)
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
211 syn keyword pythonExceptions BaseException Exception
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
212 syn keyword pythonExceptions ArithmeticError BufferError
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
213 syn keyword pythonExceptions LookupError
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
214 " builtin base exceptions removed in Python 3
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
215 syn keyword pythonExceptions EnvironmentError StandardError
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
216 " builtin exceptions (actually raised)
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
217 syn keyword pythonExceptions AssertionError AttributeError
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
218 syn keyword pythonExceptions EOFError FloatingPointError GeneratorExit
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
219 syn keyword pythonExceptions ImportError IndentationError
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
220 syn keyword pythonExceptions IndexError KeyError KeyboardInterrupt
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
221 syn keyword pythonExceptions MemoryError NameError NotImplementedError
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
222 syn keyword pythonExceptions OSError OverflowError ReferenceError
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
223 syn keyword pythonExceptions RuntimeError StopIteration SyntaxError
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
224 syn keyword pythonExceptions SystemError SystemExit TabError TypeError
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
225 syn keyword pythonExceptions UnboundLocalError UnicodeError
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
226 syn keyword pythonExceptions UnicodeDecodeError UnicodeEncodeError
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
227 syn keyword pythonExceptions UnicodeTranslateError ValueError
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
228 syn keyword pythonExceptions ZeroDivisionError
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
229 " builtin OS exceptions in Python 3
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
230 syn keyword pythonExceptions BlockingIOError BrokenPipeError
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
231 syn keyword pythonExceptions ChildProcessError ConnectionAbortedError
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
232 syn keyword pythonExceptions ConnectionError ConnectionRefusedError
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
233 syn keyword pythonExceptions ConnectionResetError FileExistsError
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
234 syn keyword pythonExceptions FileNotFoundError InterruptedError
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
235 syn keyword pythonExceptions IsADirectoryError NotADirectoryError
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
236 syn keyword pythonExceptions PermissionError ProcessLookupError
7147
c590de398af9 commit https://github.com/vim/vim/commit/ca63501fbcd1cf9c8aa9ff12c093c95b62a89ed7
Christian Brabandt <cb@256bit.org>
parents: 6951
diff changeset
237 syn keyword pythonExceptions RecursionError StopAsyncIteration
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
238 syn keyword pythonExceptions TimeoutError
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
239 " builtin exceptions deprecated/removed in Python 3
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
240 syn keyword pythonExceptions IOError VMSError WindowsError
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
241 " builtin warnings
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
242 syn keyword pythonExceptions BytesWarning DeprecationWarning FutureWarning
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
243 syn keyword pythonExceptions ImportWarning PendingDeprecationWarning
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
244 syn keyword pythonExceptions RuntimeWarning SyntaxWarning UnicodeWarning
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
245 syn keyword pythonExceptions UserWarning Warning
6951
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
246 " builtin warnings in Python 3
b2673982c625 Updated and new runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6840
diff changeset
247 syn keyword pythonExceptions ResourceWarning
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
250 if exists("python_space_error_highlight")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 " trailing whitespace
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
252 syn match pythonSpaceError display excludenl "\s\+$"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 " mixed tabs and spaces
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
254 syn match pythonSpaceError display " \+\t"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
255 syn match pythonSpaceError display "\t\+ "
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
258 " Do not spell doctests inside strings.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
259 " Notice that the end of a string, either ''', or """, will end the contained
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
260 " doctest too. Thus, we do *not* need to have it as an end pattern.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
261 if !exists("python_no_doctest_highlight")
4186
7ffc704cb7c1 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2587
diff changeset
262 if !exists("python_no_doctest_code_highlight")
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
263 syn region pythonDoctest
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
264 \ start="^\s*>>>\s" end="^\s*$"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
265 \ contained contains=ALLBUT,pythonDoctest,@Spell
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
266 syn region pythonDoctestValue
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
267 \ start=+^\s*\%(>>>\s\|\.\.\.\s\|"""\|'''\)\@!\S\++ end="$"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
268 \ contained
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
269 else
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
270 syn region pythonDoctest
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
271 \ start="^\s*>>>" end="^\s*$"
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
272 \ contained contains=@NoSpell
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
273 endif
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
274 endif
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
275
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
276 " Sync at the beginning of class, function, or method definition.
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
277 syn sync match pythonSync grouphere NONE "^\s*\%(def\|class\)\s\+\h\w*\s*("
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
279 if version >= 508 || !exists("did_python_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280 if version <= 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 let did_python_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
282 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
287 " The default highlight links. Can be overridden later.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288 HiLink pythonStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289 HiLink pythonConditional Conditional
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 HiLink pythonRepeat Repeat
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
291 HiLink pythonOperator Operator
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
292 HiLink pythonException Exception
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
293 HiLink pythonInclude Include
7147
c590de398af9 commit https://github.com/vim/vim/commit/ca63501fbcd1cf9c8aa9ff12c093c95b62a89ed7
Christian Brabandt <cb@256bit.org>
parents: 6951
diff changeset
294 HiLink pythonAsync Statement
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
295 HiLink pythonDecorator Define
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
296 HiLink pythonFunction Function
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
297 HiLink pythonComment Comment
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
298 HiLink pythonTodo Todo
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 HiLink pythonString String
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 HiLink pythonRawString String
6840
37828f7503c7 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
301 HiLink pythonQuotes String
37828f7503c7 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 6070
diff changeset
302 HiLink pythonTripleQuotes pythonQuotes
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 HiLink pythonEscape Special
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
304 if !exists("python_no_number_highlight")
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
305 HiLink pythonNumber Number
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 endif
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
307 if !exists("python_no_builtin_highlight")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308 HiLink pythonBuiltin Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 endif
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
310 if !exists("python_no_exception_highlight")
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
311 HiLink pythonExceptions Structure
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312 endif
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
313 if exists("python_space_error_highlight")
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314 HiLink pythonSpaceError Error
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315 endif
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
316 if !exists("python_no_doctest_highlight")
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
317 HiLink pythonDoctest Special
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
318 HiLink pythonDoctestValue Define
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
319 endif
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324 let b:current_syntax = "python"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325
2587
d0049ff5969e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
326 let &cpo = s:cpo_save
d0049ff5969e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
327 unlet s:cpo_save
d0049ff5969e Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
328
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1125
diff changeset
329 " vim:set sw=2 sts=2 ts=8 noet: