Browse Source

Merge 49fd76c107eb0e6b49828c90ee89a7827ad15d78 into 69760cb3accce488cc072772ca918ac2cbf384ba

Dario Giovannetti 8 years ago
parent
commit
358ce6bca7
3 changed files with 18 additions and 1 deletions
  1. 2
    0
      README.rst
  2. 3
    1
      syntax.txt
  3. 13
    0
      syntax/python.vim

+ 2
- 0
README.rst View File

95
 Options used by the script
95
 Options used by the script
96
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
96
 ~~~~~~~~~~~~~~~~~~~~~~~~~~
97
 
97
 
98
+``python_highlight_default_punctuation``
99
+  Highlight punctuation that does not fall into any syntax group
98
 ``python_highlight_builtins``
100
 ``python_highlight_builtins``
99
   Highlight builtin functions and objects
101
   Highlight builtin functions and objects
100
 ``python_highlight_builtin_objs``
102
 ``python_highlight_builtin_objs``

+ 3
- 1
syntax.txt View File

32
 <
32
 <
33
 Options used by the script
33
 Options used by the script
34
 
34
 
35
-  Highlight builtin functions and objects >
35
+  Highlight punctuation that does not fall into any syntax group >
36
+    :let python_highlight_default_punctuation
37
+<  Highlight builtin functions and objects >
36
     :let python_highlight_builtins = 1
38
     :let python_highlight_builtins = 1
37
 <  Highlight builtin objects only >
39
 <  Highlight builtin objects only >
38
     :let python_highlight_builtin_objs = 1
40
     :let python_highlight_builtin_objs = 1

+ 13
- 0
syntax/python.vim View File

66
 " Option names used by the script
66
 " Option names used by the script
67
 " -------------------------------
67
 " -------------------------------
68
 "
68
 "
69
+"    python_highlight_default_punctuation   Highlight punctuation that does not
70
+"                                           fall into any syntax group
69
 "    python_highlight_builtins              Highlight builtin functions and
71
 "    python_highlight_builtins              Highlight builtin functions and
70
 "                                           objects
72
 "                                           objects
71
 "      python_highlight_builtin_objs        Highlight builtin objects only
73
 "      python_highlight_builtin_objs        Highlight builtin objects only
131
 call s:EnableByDefault("g:python_slow_sync")
133
 call s:EnableByDefault("g:python_slow_sync")
132
 
134
 
133
 if s:Enabled("g:python_highlight_all")
135
 if s:Enabled("g:python_highlight_all")
136
+  call s:EnableByDefault("g:python_highlight_default_punctuation")
134
   call s:EnableByDefault("g:python_highlight_builtins")
137
   call s:EnableByDefault("g:python_highlight_builtins")
135
   if s:Enabled("g:python_highlight_builtins")
138
   if s:Enabled("g:python_highlight_builtins")
136
     call s:EnableByDefault("g:python_highlight_builtin_objs")
139
     call s:EnableByDefault("g:python_highlight_builtin_objs")
146
   call s:EnableByDefault("g:python_print_as_function")
149
   call s:EnableByDefault("g:python_print_as_function")
147
 endif
150
 endif
148
 
151
 
152
+"
153
+" Default punctuation
154
+"
155
+
156
+if s:Enabled("g:python_highlight_default_punctuation")
157
+  syn match pythonPunctuation "[^A-Za-z0-9_]"
158
+endif
159
+
149
 "
160
 "
150
 " Keywords
161
 " Keywords
151
 "
162
 "
495
     command -nargs=+ HiLink hi def link <args>
506
     command -nargs=+ HiLink hi def link <args>
496
   endif
507
   endif
497
 
508
 
509
+  HiLink pythonPunctuation      Special
510
+
498
   HiLink pythonStatement        Statement
511
   HiLink pythonStatement        Statement
499
   HiLink pythonImport           Include
512
   HiLink pythonImport           Include
500
   HiLink pythonFunction         Function
513
   HiLink pythonFunction         Function