File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed
Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ Revision 3.3.5 (2013-08-31):
22
33 - Highlight 'import', 'from' and 'as' as include statements.
44 Patch by pydave at GitHub.
5+ - Added new option 'python_highlight_file_headers_as_comments' (disabled by
6+ default) to highlight shebang and coding file headers as comments.
7+ Proposed by pydave at GitHub.
58
69Revision 3.3.4 (2013-08-11):
710
Original file line number Diff line number Diff line change @@ -117,6 +117,8 @@ Options used by the script
117117 Highlight doc-tests
118118``python_print_as_function ``
119119 Highlight ``print `` statement as function for Python 2
120+ ``python_highlight_file_headers_as_comments ``
121+ Highlight shebang and coding headers as comments
120122``python_highlight_all ``
121123 Enable all the options above. *NOTE: This option don't override any
122124 previously set options *
Original file line number Diff line number Diff line change 7373" python_highlight_doctests Highlight doc-tests
7474" python_print_as_function Highlight 'print' statement as
7575" function for Python 2
76+ " python_highlight_file_headers_as_comments
77+ " Highlight shebang and coding
78+ " headers as comments
7679"
7780" python_highlight_all Enable all the options above
7881" NOTE: This option don't override
@@ -179,8 +182,10 @@ syn match pythonDot "\." display containedin=pythonDottedName
179182"
180183
181184syn match pythonComment " #.*$" display contains =pythonTodo,@Spell
182- syn match pythonRun " \% ^#!.*$"
183- syn match pythonCoding " \% ^.*\% (\n .*\)\? #.*coding[:=]\s *[0-9A-Za-z-_.]\+ .*$"
185+ if ! s: Enabled (" g:python_highlight_file_headers_as_comments" )
186+ syn match pythonRun " \% ^#!.*$"
187+ syn match pythonCoding " \% ^.*\% (\n .*\)\? #.*coding[:=]\s *[0-9A-Za-z-_.]\+ .*$"
188+ endif
184189syn keyword pythonTodo TODO FIXME XXX contained
185190
186191"
@@ -482,8 +487,10 @@ if version >= 508 || !exists("did_python_syn_inits")
482487 HiLink pythonDot Normal
483488
484489 HiLink pythonComment Comment
485- HiLink pythonCoding Special
486- HiLink pythonRun Special
490+ if ! s: Enabled (" g:python_highlight_file_headers_as_comments" )
491+ HiLink pythonCoding Special
492+ HiLink pythonRun Special
493+ endif
487494 HiLink pythonTodo Todo
488495
489496 HiLink pythonError Error
You can’t perform that action at this time.
0 commit comments