Mercurial > cpython-lru_cache-weakref
annotate Misc/Vim/python.vim @ 36652:8db985b4086e legacy-trunk
Add a script that auto-generates a Vim syntax highlighting file for Python.
Just symlink or copy python.vim to ~/.vim/syntax/ . Also included is a sample
Python file with basic expressions to make sure they are highlighted.
Also add a Vim directory in Misc to hold all Vim configuration files.
| author | Brett Cannon <bcannon@gmail.com> |
|---|---|
| date | Sat, 25 Feb 2006 14:52:53 +0000 |
| parents | |
| children | f8ffa7cbf960 |
| rev | line source |
|---|---|
|
36652
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
1 " Auto-generated Vim syntax file for Python |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
2 " |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
3 " To use: copy or symlink to ~/.vim/syntax/python.vim |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
4 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
5 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
6 if exists("b:current_syntax") |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
7 finish |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
8 endif |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
9 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
10 if exists("python_highlight_all") |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
11 let python_highlight_numbers = 1 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
12 let python_highlight_builtins = 1 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
13 let python_highlight_exceptions = 1 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
14 let python_highlight_space_errors = 1 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
15 endif |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
16 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
17 syn keyword pythonStatement assert break continue del except exec finally |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
18 syn keyword pythonStatement global lambda pass print raise return try yield |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
19 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
20 syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
21 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
22 syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" contained |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
23 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
24 syn keyword pythonRepeat for while |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
25 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
26 syn keyword pythonConditional if elif else |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
27 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
28 syn keyword pythonOperator and in is not or |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
29 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
30 syn keyword pythonPreCondit import from |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
31 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
32 syn match pythonComment "#.*$" contains=pythonTodo |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
33 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
34 syn keyword pythonTodo TODO FIXME XXX contained |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
35 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
36 syn region pythonString matchgroup=Normal start=+[uU]\='+ end=+'+ skip=+\\\\\|\\'+ contains=pythonEscape |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
37 syn region pythonString matchgroup=Normal start=+[uU]\="+ end=+"+ skip=+\\\\\|\\"+ contains=pythonEscape |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
38 syn region pythonString matchgroup=Normal start=+[uU]\="""+ end=+"""+ contains=pythonEscape |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
39 syn region pythonString matchgroup=Normal start=+[uU]\='''+ end=+'''+ contains=pythonEscape |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
40 syn region pythonString matchgroup=Normal start=+[uU]\=[rR]'+ end=+'+ skip=+\\\\\|\\'+ |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
41 syn region pythonString matchgroup=Normal start=+[uU]\=[rR]"+ end=+"+ skip=+\\\\\|\\"+ |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
42 syn region pythonString matchgroup=Normal start=+[uU]\=[rR]"""+ end=+"""+ |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
43 syn region pythonString matchgroup=Normal start=+[uU]\=[rR]'''+ end=+'''+ |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
44 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
45 syn match pythonEscape +\\[abfnrtv\'"\\]+ contained |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
46 syn match pythonEscape "\\\o\{1,3}" contained |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
47 syn match pythonEscape "\\x\x\{2}" contained |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
48 syn match pythonEscape "\(\\u\x\{4}\|\\U\x\{8}\)" contained |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
49 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
50 syn match pythonEscape "\\$" |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
51 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
52 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
53 if exists("python_highlight_numbers") |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
54 syn match pythonNumber "\<0x\x\+[Ll]\=\>" |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
55 syn match pythonNumber "\<\d\+[LljJ]\=\>" |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
56 syn match pythonNumber "\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>" |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
57 syn match pythonNumber "\<\d\+\.\([eE][+-]\=\d\+\)\=[jJ]\=\>" |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
58 syn match pythonNumber "\<\d\+\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>" |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
59 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
60 endif |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
61 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
62 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
63 if exists("python_highlight_builtins") |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
64 syn keyword pythonBuiltin unichr all set abs vars int __import__ unicode |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
65 syn keyword pythonBuiltin enumerate reduce coerce intern exit issubclass |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
66 syn keyword pythonBuiltin divmod file Ellipsis apply isinstance open any |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
67 syn keyword pythonBuiltin locals help filter basestring slice copyright min |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
68 syn keyword pythonBuiltin super sum tuple hex execfile long id xrange chr |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
69 syn keyword pythonBuiltin complex bool zip pow dict True oct NotImplemented |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
70 syn keyword pythonBuiltin map None float hash getattr buffer max reversed |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
71 syn keyword pythonBuiltin object quit len repr callable credits setattr |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
72 syn keyword pythonBuiltin eval frozenset sorted ord __debug__ hasattr |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
73 syn keyword pythonBuiltin delattr False input license classmethod type |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
74 syn keyword pythonBuiltin raw_input list iter compile reload range globals |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
75 syn keyword pythonBuiltin staticmethod str property round dir cmp |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
76 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
77 endif |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
78 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
79 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
80 if exists("python_highlight_exceptions") |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
81 syn keyword pythonException GeneratorExit ImportError RuntimeError |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
82 syn keyword pythonException UnicodeTranslateError MemoryError StopIteration |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
83 syn keyword pythonException PendingDeprecationWarning EnvironmentError |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
84 syn keyword pythonException LookupError OSError DeprecationWarning |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
85 syn keyword pythonException UnicodeError FloatingPointError ReferenceError |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
86 syn keyword pythonException NameError OverflowWarning IOError SyntaxError |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
87 syn keyword pythonException FutureWarning SystemExit Exception EOFError |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
88 syn keyword pythonException StandardError ValueError TabError KeyError |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
89 syn keyword pythonException ZeroDivisionError SystemError |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
90 syn keyword pythonException UnicodeDecodeError IndentationError |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
91 syn keyword pythonException AssertionError TypeError IndexError |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
92 syn keyword pythonException RuntimeWarning KeyboardInterrupt UserWarning |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
93 syn keyword pythonException SyntaxWarning UnboundLocalError ArithmeticError |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
94 syn keyword pythonException Warning NotImplementedError AttributeError |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
95 syn keyword pythonException OverflowError UnicodeEncodeError |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
96 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
97 endif |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
98 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
99 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
100 if exists("python_highlight_space_errors") |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
101 syn match pythonSpaceError display excludenl "\S\s\+$"ms=s+1 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
102 syn match pythonSpaceError display " \+\t" |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
103 syn match pythonSpaceError display "\t\+ " |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
104 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
105 endif |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
106 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
107 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
108 hi def link pythonStatement Statement |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
109 hi def link pythonStatement Statement |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
110 hi def link pythonFunction Function |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
111 hi def link pythonRepeat Repeat |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
112 hi def link pythonConditional Conditional |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
113 hi def link pythonOperator Operator |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
114 hi def link pythonPreCondit PreCondit |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
115 hi def link pythonComment Comment |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
116 hi def link pythonTodo Todo |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
117 hi def link pythonString String |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
118 hi def link pythonEscape Special |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
119 hi def link pythonEscape Special |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
120 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
121 if exists("python_highlight_numbers") |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
122 hi def link pythonNumber Number |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
123 endif |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
124 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
125 if exists("python_highlight_builtins") |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
126 hi def link pythonBuiltin Function |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
127 endif |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
128 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
129 if exists("python_highlight_exceptions") |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
130 hi def link pythonException Exception |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
131 endif |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
132 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
133 if exists("python_highlight_space_errors") |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
134 hi def link pythonSpaceError Error |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
135 endif |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
136 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
137 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
138 " Uncomment the 'minlines' statement line and comment out the 'maxlines' |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
139 " statement line; changes behaviour to look at least 2000 lines previously for |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
140 " syntax matches instead of at most 200 lines |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
141 syn sync match pythonSync grouphere NONE "):$" |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
142 syn sync maxlines=200 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
143 "syn sync minlines=2000 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
144 |
|
8db985b4086e
Add a script that auto-generates a Vim syntax highlighting file for Python.
Brett Cannon <bcannon@gmail.com>
parents:
diff
changeset
|
145 let b:current_syntax = "python" |
