mirror of
https://github.com/vim-python/python-syntax.git
synced 2025-12-08 21:54:48 +08:00
Add new option 'python_highlight_file_headers_as_comments'
The option is disabled by default and when enabled highlight shebang and coding file headers as comments instead of special characters.
This commit is contained in:
@@ -2,6 +2,9 @@ Revision 3.3.5 (2013-08-31):
|
|||||||
|
|
||||||
- Highlight 'import', 'from' and 'as' as include statements.
|
- Highlight 'import', 'from' and 'as' as include statements.
|
||||||
Patch by pydave at GitHub.
|
Patch by pydave at GitHub.
|
||||||
|
- Added new option 'python_highlight_file_headers_as_comments' (disabled by
|
||||||
|
default) to highlight shebang and coding file headers as comments.
|
||||||
|
Proposed by pydave at GitHub.
|
||||||
|
|
||||||
Revision 3.3.4 (2013-08-11):
|
Revision 3.3.4 (2013-08-11):
|
||||||
|
|
||||||
|
|||||||
@@ -117,6 +117,8 @@ Options used by the script
|
|||||||
Highlight doc-tests
|
Highlight doc-tests
|
||||||
``python_print_as_function``
|
``python_print_as_function``
|
||||||
Highlight ``print`` statement as function for Python 2
|
Highlight ``print`` statement as function for Python 2
|
||||||
|
``python_highlight_file_headers_as_comments``
|
||||||
|
Highlight shebang and coding headers as comments
|
||||||
``python_highlight_all``
|
``python_highlight_all``
|
||||||
Enable all the options above. *NOTE: This option don't override any
|
Enable all the options above. *NOTE: This option don't override any
|
||||||
previously set options*
|
previously set options*
|
||||||
|
|||||||
@@ -73,6 +73,9 @@
|
|||||||
" python_highlight_doctests Highlight doc-tests
|
" python_highlight_doctests Highlight doc-tests
|
||||||
" python_print_as_function Highlight 'print' statement as
|
" python_print_as_function Highlight 'print' statement as
|
||||||
" function for Python 2
|
" function for Python 2
|
||||||
|
" python_highlight_file_headers_as_comments
|
||||||
|
" Highlight shebang and coding
|
||||||
|
" headers as comments
|
||||||
"
|
"
|
||||||
" python_highlight_all Enable all the options above
|
" python_highlight_all Enable all the options above
|
||||||
" NOTE: This option don't override
|
" NOTE: This option don't override
|
||||||
@@ -179,8 +182,10 @@ syn match pythonDot "\." display containedin=pythonDottedName
|
|||||||
"
|
"
|
||||||
|
|
||||||
syn match pythonComment "#.*$" display contains=pythonTodo,@Spell
|
syn match pythonComment "#.*$" display contains=pythonTodo,@Spell
|
||||||
|
if !s:Enabled("g:python_highlight_file_headers_as_comments")
|
||||||
syn match pythonRun "\%^#!.*$"
|
syn match pythonRun "\%^#!.*$"
|
||||||
syn match pythonCoding "\%^.*\%(\n.*\)\?#.*coding[:=]\s*[0-9A-Za-z-_.]\+.*$"
|
syn match pythonCoding "\%^.*\%(\n.*\)\?#.*coding[:=]\s*[0-9A-Za-z-_.]\+.*$"
|
||||||
|
endif
|
||||||
syn keyword pythonTodo TODO FIXME XXX contained
|
syn keyword pythonTodo TODO FIXME XXX contained
|
||||||
|
|
||||||
"
|
"
|
||||||
@@ -482,8 +487,10 @@ if version >= 508 || !exists("did_python_syn_inits")
|
|||||||
HiLink pythonDot Normal
|
HiLink pythonDot Normal
|
||||||
|
|
||||||
HiLink pythonComment Comment
|
HiLink pythonComment Comment
|
||||||
|
if !s:Enabled("g:python_highlight_file_headers_as_comments")
|
||||||
HiLink pythonCoding Special
|
HiLink pythonCoding Special
|
||||||
HiLink pythonRun Special
|
HiLink pythonRun Special
|
||||||
|
endif
|
||||||
HiLink pythonTodo Todo
|
HiLink pythonTodo Todo
|
||||||
|
|
||||||
HiLink pythonError Error
|
HiLink pythonError Error
|
||||||
|
|||||||
Reference in New Issue
Block a user