diff options
author | Christian Clason <c.clason@uni-graz.at> | 2023-02-28 09:34:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-28 09:34:27 +0100 |
commit | 66c384d4e806a5e8de53bc57a05f0ddd8c8a9d1c (patch) | |
tree | 0744198130c837d09161138c1a60f6a4a5c47335 /runtime/syntax/python.vim | |
parent | 8acb3d742ce68adadf1def9e1d1bb5bfd671988c (diff) | |
download | rneovim-66c384d4e806a5e8de53bc57a05f0ddd8c8a9d1c.tar.gz rneovim-66c384d4e806a5e8de53bc57a05f0ddd8c8a9d1c.tar.bz2 rneovim-66c384d4e806a5e8de53bc57a05f0ddd8c8a9d1c.zip |
vim-patch:partial:dd60c365cd26 (#22437)
vim-patch:partial:dd60c365cd26
Update runtime files
https://github.com/vim/vim/commit/dd60c365cd2630794be84d63c4fe287124a30b97
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Skip: eval.txt, repeat.txt (needs `getscriptinfo()`)
Diffstat (limited to 'runtime/syntax/python.vim')
-rw-r--r-- | runtime/syntax/python.vim | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/runtime/syntax/python.vim b/runtime/syntax/python.vim index ef4da1b448..831fb92f4c 100644 --- a/runtime/syntax/python.vim +++ b/runtime/syntax/python.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Python " Maintainer: Zvezdan Petkovic <zpetkovic@acm.org> -" Last Change: 2022 Jun 28 +" Last Change: 2023 Feb 26 " Credits: Neil Schemenauer <nas@python.ca> " Dmitry Vasiliev " @@ -35,12 +35,26 @@ " " let python_highlight_all = 1 " +" The use of Python 2 compatible syntax highlighting can be enforced. +" The straddling code (Python 2 and 3 compatible), up to Python 3.5, +" will be also supported. +" +" let python_use_python2_syntax = 1 +" +" This option will exclude all modern Python 3.6 or higher features. +" " quit when a syntax file was already loaded. if exists("b:current_syntax") finish endif +" Use of Python 2 and 3.5 or lower requested. +if exists("python_use_python2_syntax") + runtime! syntax/python2.vim + finish +endif + " We need nocompatible mode in order to continue lines with backslashes. " Original setting will be restored. let s:cpo_save = &cpo @@ -91,8 +105,8 @@ syn keyword pythonInclude from import syn keyword pythonAsync async await " Soft keywords -" These keywords do not mean anything unless used in the right context -" See https://docs.python.org/3/reference/lexical_analysis.html#soft-keywords +" These keywords do not mean anything unless used in the right context. +" See https://docs.python.org/3/reference/lexical_analysis.html#soft-keywords " for more on this. syn match pythonConditional "^\s*\zscase\%(\s\+.*:.*$\)\@=" syn match pythonConditional "^\s*\zsmatch\%(\s\+.*:\s*\%(#.*\)\=$\)\@=" |