mirror of
https://github.com/gryf/python-syntax.git
synced 2025-12-19 20:38:07 +01:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10d2c07687 | ||
|
|
d948f835b4 | ||
|
|
4d925a99dd | ||
|
|
44f1855902 | ||
|
|
716ded1d56 |
@@ -1,3 +1,8 @@
|
|||||||
|
Revision 3.5.0 (2015-06-10):
|
||||||
|
|
||||||
|
- Add support for 'async ...' and 'await' keywords introduced in
|
||||||
|
Python 3.5. Patch by Ihor Gorobets
|
||||||
|
|
||||||
Revision 3.3.7 (2014-12-27):
|
Revision 3.3.7 (2014-12-27):
|
||||||
|
|
||||||
- Add support for Python 3 non-ASCII decorator names.
|
- Add support for Python 3 non-ASCII decorator names.
|
||||||
@@ -11,10 +16,10 @@ Revision 3.3.6 (2013-11-18):
|
|||||||
Revision 3.3.5 (2013-08-31):
|
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 David Briscoe
|
||||||
- Added new option 'python_highlight_file_headers_as_comments' (disabled by
|
- Added new option 'python_highlight_file_headers_as_comments' (disabled by
|
||||||
default) to highlight shebang and coding file headers as comments.
|
default) to highlight shebang and coding file headers as comments.
|
||||||
Proposed by pydave at GitHub.
|
Proposed by David Briscoe.
|
||||||
|
|
||||||
Revision 3.3.4 (2013-08-11):
|
Revision 3.3.4 (2013-08-11):
|
||||||
|
|
||||||
|
|||||||
23
README.rst
23
README.rst
@@ -81,7 +81,7 @@ Option and commands to select Python version
|
|||||||
|
|
||||||
``python_version_2``
|
``python_version_2``
|
||||||
Enable highlighting for Python 2 (Python 3 highlighting is enabled by
|
Enable highlighting for Python 2 (Python 3 highlighting is enabled by
|
||||||
default). Can also be set as a local to buffer ``b:python_version_2``
|
default). Also can be set as a local to buffer ``b:python_version_2``
|
||||||
variable.
|
variable.
|
||||||
|
|
||||||
The following local to buffer commands can be used to switch between two
|
The following local to buffer commands can be used to switch between two
|
||||||
@@ -130,15 +130,16 @@ Contributors
|
|||||||
|
|
||||||
List of the contributors in alphabetical order:
|
List of the contributors in alphabetical order:
|
||||||
|
|
||||||
- Andrea Riciputi
|
- `Andrea Riciputi <https://github.com/mrrech>`_
|
||||||
- Anton Butanaev
|
- Anton Butanaev
|
||||||
- Caleb Adamantine
|
- Caleb Adamantine
|
||||||
- Elizabeth Myers
|
- `David Briscoe <https://github.com/idbrii>`_
|
||||||
- Jeroen Ruigrok van der Werven
|
- `Elizabeth Myers <https://github.com/Elizafox>`_
|
||||||
- John Eikenberry
|
- `Ihor Gorobets <https://github.com/iho>`_
|
||||||
- Marc Weber
|
- `Jeroen Ruigrok van der Werven <https://github.com/ashemedai>`_
|
||||||
- Pedro Algarvio
|
- `John Eikenberry <https://github.com/eikenb>`_
|
||||||
- pydave at GitHub
|
- `Marc Weber <https://github.com/MarcWeber>`_
|
||||||
- Victor Salgado
|
- `Pedro Algarvio <https://github.com/s0undt3ch>`_
|
||||||
- Will Gray
|
- `Victor Salgado <https://github.com/mcsalgado>`_
|
||||||
- Yuri Habrusiev
|
- `Will Gray <https://github.com/graywh>`_
|
||||||
|
- `Yuri Habrusiev <https://github.com/yuriihabrusiev>`_
|
||||||
|
|||||||
3
TODO.txt
3
TODO.txt
@@ -2,7 +2,8 @@ Now
|
|||||||
===
|
===
|
||||||
|
|
||||||
- It seems python.vim doesn't highlight special characters inside strings by
|
- It seems python.vim doesn't highlight special characters inside strings by
|
||||||
default but only when it reloaded?
|
default but only when reloaded? Or maybe only when set to Python 2
|
||||||
|
by default?
|
||||||
|
|
||||||
- Add support for slice syntax:
|
- Add support for slice syntax:
|
||||||
http://img155.imageshack.us/img155/7767/screenshotgs.png
|
http://img155.imageshack.us/img155/7767/screenshotgs.png
|
||||||
|
|||||||
65
syntax.txt
Normal file
65
syntax.txt
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
PYTHON *python.vim* *ft-python-syntax*
|
||||||
|
|
||||||
|
There are two commands to enable or disable an option for python.vim
|
||||||
|
|
||||||
|
Enable option: >
|
||||||
|
:let option_name = 1
|
||||||
|
<
|
||||||
|
Disable option: >
|
||||||
|
:let option_name = 0
|
||||||
|
<
|
||||||
|
For example to enable all syntax highlighting features you can place the
|
||||||
|
following command in your `~/.vimrc` script: >
|
||||||
|
|
||||||
|
let python_highlight_all = 1
|
||||||
|
<
|
||||||
|
Option and commands to select Python version: >
|
||||||
|
|
||||||
|
:let python_version_2 = 1
|
||||||
|
<
|
||||||
|
Enable highlighting for Python 2 (Python 3 highlighting is enabled by
|
||||||
|
default). Also can be set as a local to buffer `b:python_version_2`
|
||||||
|
variable.
|
||||||
|
|
||||||
|
The following local to buffer commands can be used to switch between two
|
||||||
|
highlighting modes:
|
||||||
|
|
||||||
|
Switch to Python 2 highlighting mode >
|
||||||
|
:Python2Syntax
|
||||||
|
<
|
||||||
|
Switch to Python 3 highlighting mode >
|
||||||
|
:Python3Syntax
|
||||||
|
<
|
||||||
|
Options used by the script
|
||||||
|
|
||||||
|
Highlight builtin functions and objects >
|
||||||
|
:let python_highlight_builtins = 1
|
||||||
|
< Highlight builtin objects only >
|
||||||
|
:let python_highlight_builtin_objs = 1
|
||||||
|
< Highlight builtin functions only >
|
||||||
|
:let python_highlight_builtin_funcs = 1
|
||||||
|
< Highlight standard exceptions >
|
||||||
|
:let python_highlight_exceptions = 1
|
||||||
|
< Highlight `%` string formatting >
|
||||||
|
:let python_highlight_string_formatting = 1
|
||||||
|
< Highlight syntax of `str.format` syntax >
|
||||||
|
:let python_highlight_string_format = 1
|
||||||
|
< Highlight syntax of `string.Template` >
|
||||||
|
:let python_highlight_string_templates = 1
|
||||||
|
< Highlight indentation errors >
|
||||||
|
:let python_highlight_indent_errors = 1
|
||||||
|
< Highlight trailing spaces >
|
||||||
|
:let python_highlight_space_errors = 1
|
||||||
|
< Highlight doc-tests >
|
||||||
|
:let python_highlight_doctests = 1
|
||||||
|
< Highlight `print` statement as function for Python 2 >
|
||||||
|
:let python_print_as_function = 1
|
||||||
|
< Highlight shebang and coding headers as comments >
|
||||||
|
:let python_highlight_file_headers_as_comments = 1
|
||||||
|
< Enable all the options above. NOTE: This option don't override any
|
||||||
|
previously set options >
|
||||||
|
:let python_highlight_all = 1
|
||||||
|
< Can be set to 0 for slow machines >
|
||||||
|
:let python_slow_sync = 1
|
||||||
|
<
|
||||||
|
vim:tw=78:sw=4:ts=8:ft=help:norl:
|
||||||
@@ -1,10 +1,11 @@
|
|||||||
" Vim syntax file
|
" Vim syntax file
|
||||||
" Language: Python
|
" Language: Python
|
||||||
" Maintainer: Dmitry Vasiliev <dima at hlabs dot org>
|
" Current Maintainer: Dmitry Vasiliev <dima at hlabs dot org>
|
||||||
|
" Previous Maintainer: Neil Schemenauer <nas at python dot ca>
|
||||||
" URL: https://github.com/hdima/python-syntax
|
" URL: https://github.com/hdima/python-syntax
|
||||||
" Last Change: 2014-12-27
|
" Last Change: 2015-06-10
|
||||||
" Filenames: *.py
|
" Filenames: *.py
|
||||||
" Version: 3.3.7
|
" Version: 3.5.0
|
||||||
"
|
"
|
||||||
" Based on python.vim (from Vim 6.1 distribution)
|
" Based on python.vim (from Vim 6.1 distribution)
|
||||||
" by Neil Schemenauer <nas at python dot ca>
|
" by Neil Schemenauer <nas at python dot ca>
|
||||||
@@ -25,12 +26,13 @@
|
|||||||
" Andrea Riciputi
|
" Andrea Riciputi
|
||||||
" Anton Butanaev
|
" Anton Butanaev
|
||||||
" Caleb Adamantine
|
" Caleb Adamantine
|
||||||
|
" David Briscoe
|
||||||
" Elizabeth Myers
|
" Elizabeth Myers
|
||||||
|
" Ihor Gorobets
|
||||||
" Jeroen Ruigrok van der Werven
|
" Jeroen Ruigrok van der Werven
|
||||||
" John Eikenberry
|
" John Eikenberry
|
||||||
" Marc Weber
|
" Marc Weber
|
||||||
" Pedro Algarvio
|
" Pedro Algarvio
|
||||||
" pydave at GitHub
|
|
||||||
" Victor Salgado
|
" Victor Salgado
|
||||||
" Will Gray
|
" Will Gray
|
||||||
" Yuri Habrusiev
|
" Yuri Habrusiev
|
||||||
@@ -173,6 +175,11 @@ else
|
|||||||
syn match pythonStatement "\<yield\s\+from\>" display
|
syn match pythonStatement "\<yield\s\+from\>" display
|
||||||
syn keyword pythonBoolean True False
|
syn keyword pythonBoolean True False
|
||||||
syn match pythonFunction "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
|
syn match pythonFunction "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained
|
||||||
|
syn keyword pythonStatement await
|
||||||
|
syn match pythonStatement "\<async\s\+def\>" display
|
||||||
|
syn match pythonStatement "\<async\s\+with\>" display
|
||||||
|
syn match pythonStatement "\<async\s\+for\>" display
|
||||||
|
syn match pythonStatement "\<async\s\+with\>" display
|
||||||
endif
|
endif
|
||||||
|
|
||||||
"
|
"
|
||||||
|
|||||||
Reference in New Issue
Block a user