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,6 +95,8 @@ highlighting modes:
95 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 100
 ``python_highlight_builtins``
99 101
   Highlight builtin functions and objects
100 102
 ``python_highlight_builtin_objs``

+ 3
- 1
syntax.txt View File

@@ -32,7 +32,9 @@ highlighting modes:
32 32
 <
33 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 38
     :let python_highlight_builtins = 1
37 39
 <  Highlight builtin objects only >
38 40
     :let python_highlight_builtin_objs = 1

+ 13
- 0
syntax/python.vim View File

@@ -66,6 +66,8 @@
66 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 71
 "    python_highlight_builtins              Highlight builtin functions and
70 72
 "                                           objects
71 73
 "      python_highlight_builtin_objs        Highlight builtin objects only
@@ -131,6 +133,7 @@ endfunction
131 133
 call s:EnableByDefault("g:python_slow_sync")
132 134
 
133 135
 if s:Enabled("g:python_highlight_all")
136
+  call s:EnableByDefault("g:python_highlight_default_punctuation")
134 137
   call s:EnableByDefault("g:python_highlight_builtins")
135 138
   if s:Enabled("g:python_highlight_builtins")
136 139
     call s:EnableByDefault("g:python_highlight_builtin_objs")
@@ -146,6 +149,14 @@ if s:Enabled("g:python_highlight_all")
146 149
   call s:EnableByDefault("g:python_print_as_function")
147 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 161
 " Keywords
151 162
 "
@@ -495,6 +506,8 @@ if version >= 508 || !exists("did_python_syn_inits")
495 506
     command -nargs=+ HiLink hi def link <args>
496 507
   endif
497 508
 
509
+  HiLink pythonPunctuation      Special
510
+
498 511
   HiLink pythonStatement        Statement
499 512
   HiLink pythonImport           Include
500 513
   HiLink pythonFunction         Function