aboutsummaryrefslogtreecommitdiff
path: root/runtime/syntax/python.vim
Commit message (Collapse)AuthorAge
* vim-patch:cbcb209: runtime(python): missing Python syntax keywordszeertzjq2026-09-11
| | | | | | | | | | | | | Problem: Missing newer Python keywords and builtins in syntax highlighting. Solution: Add aiter, anext, BaseExceptionGroup, ExceptionGroup, PythonFinalizationError, and EncodingWarning to the Python syntax file (231tr0n). closes: vim/vim#21254 https://github.com/vim/vim/commit/cbcb209221a2e19f674c7b2ed789132606761b7c Co-authored-by: 231tr0n <zeltronsrikar@gmail.com>
* vim-patch:e9c5e56: runtime(python): improve performance of number and ↵zeertzjq2026-09-02
| | | | | | | | | | | | | | | | | | | | | ellipsis matching (#41608) Problem: The floating-point `.d` number match and the two ellipsis matches are slow: each begins with a look-behind, which cannot be reduced to a fixed first character, so the automatic regexp engine selects the slower NFA backend for them. Solution: Force the backtracking engine with \%#=1 on those three patterns; it evaluates the look-behind far more efficiently. Highlighting is unchanged. Measured with :syntime over a 40000 line corpus: the three affected rules drop from ~0.13s to ~0.008s (about -93%), which cuts the total syntax parse cost by ~10% (1.85s to 1.65s). closes: vim/vim#21194 https://github.com/vim/vim/commit/e9c5e56081d1923caab5efce1f6fca4e235cf350 Co-authored-by: Julien Voisin <julien.voisin@dustri.org>
* vim-patch:916809a: runtime(python): highlight the 'lazy' soft keywordzeertzjq2026-07-27
| | | | | | | | | | | | Lazy imports (PEP 810, to be released in Python 3.15) introduces a `lazy` soft keyword that's recognized when it precedes a `from` or `import` keyword. closes: vim/vim#20342 https://github.com/vim/vim/commit/916809ae1e3e562e0a6220a6e7e08f38b8a23b62 Co-authored-by: Jon Parise <jon@indelible.org>
* vim-patch:2cf18fc: runtime(python): Update syntax, improve pythonNumber ↵zeertzjq2026-03-12
| | | | | | | | | | | | | | pattern performance (#38263) - Improve the performance of all pythonNumber patterns by unrolling digit/underscore sequence loops. - Split the float literal pattern into two simpler patterns. fixes: vim/vim#19625 (Reported by James McCoy) closes: vim/vim#19630 https://github.com/vim/vim/commit/2cf18fcc240030880bbd138e5174e436a3f20823 Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* vim-patch:632fd8b: runtime(python): Highlight built-in constants in Pythonzeertzjq2026-01-27
| | | | | | | | | | | Also add syntax tests for those newly constants. closes: vim/vim#17788 closes: vim/vim#18922 https://github.com/vim/vim/commit/632fd8bb968b029d0a7c40a00101008ea5200b91 Co-authored-by: Rob B <github@0x7e.net>
* vim-patch:8d8c907: runtime(python): Highlight t-stringszeertzjq2025-12-04
| | | | | | | | | | | | - Highlight t-strings - Update comments - Add tests closes: vim/vim#18679 https://github.com/vim/vim/commit/8d8c9074c3cbb33b2b8b97556bdb7267e2617b93 Co-authored-by: Rob B <github@0x7e.net>
* vim-patch:900c747: runtime(python): fix 'type' syntax highlighting (#35918)zeertzjq2025-09-26
| | | | | | | | | | The previous patterns unintentionally highlighted words like 'typename'. addresses: https://github.com/vim/vim/pull/18090#issuecomment-3333025523 closes: vim/vim#18394 https://github.com/vim/vim/commit/900c747da393b031f3347428fb640224ac2f5442 Co-authored-by: Jon Parise <jon@indelible.org>
* vim-patch:15070ee: runtime(python): Update syntax, fix pythonEllipsis ↵zeertzjq2025-09-12
| | | | | | | | | | pattern (#35724) fixes: vim/vim#18263 closes: vim/vim#18264 https://github.com/vim/vim/commit/15070eee2f1e11a69a4c2d99bad03c8f6756e6e0 Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* vim-patch:77cfc49: runtime(python): highlight ellipsis literalszeertzjq2025-09-09
| | | | | | | | | | | | | | | | | | | | | | | | The ellipsis literal (`...`) can be used in multiple contexts: - Placeholders: `class Foo: ...` - Containers: `Tuple[int, ...]` - Assignments: `x = ...` This is a trickier pattern to match because we can't rely on keyword boundaries, so we instead look for exactly three dots (`...`). This does mean that we will match the `...` portion of `x...x`, which isn't valid Python syntax, but I think that's an acceptable trade-off that avoids making this pattern much more complex. Reference: - https://docs.python.org/3/library/constants.html#Ellipsis closes: vim/vim#18107 https://github.com/vim/vim/commit/77cfc49060a50daefd1675b8a1dece0e6e943384 Co-authored-by: Jon Parise <jon@indelible.org>
* vim-patch:6bb16d2: runtime(python): Update syntax file, fix f-string float ↵zeertzjq2025-09-09
| | | | | | | | | | | | | | | | | | highlighting Fix matching of floats at the beginning of an f-string replacement field, immediately after the opening brace. The existing pattern, using `\zs`, cannot consume the already matched `{` so use a lookbehind instead. See comment: https://github.com/vim/vim/pull/17962#issuecomment-3201550443 closes: vim/vim#18220 https://github.com/vim/vim/commit/6bb16d2cee87f834f003bf368ce70c5688242ac1 Co-authored-by: Doug Kearns <dougkearns@gmail.com>
* vim-patch:f1212a7: runtime(python): Do not match contained identifiers as ↵zeertzjq2025-09-06
| | | | | | | | | | | pythonType related: vim/vim#17962 closes: vim/vim#18206 https://github.com/vim/vim/commit/f1212a7b4554f2f544b581f7e819d6ef67c5e9ad Co-authored-by: Rob B <github@0x7e.net>
* vim-patch:d2b28dd: runtime(python): add syntax support inside f-stringszeertzjq2025-09-06
| | | | | | | | | fixes: vim/vim#14033 closes: vim/vim#17962 https://github.com/vim/vim/commit/d2b28ddfc2a7350c2f63b75d06cc53d17b3a66ff Co-authored-by: Rob B <github@0x7e.net>
* vim-patch:99964e2: runtime(python): support 'type's soft keyword formzeertzjq2025-08-24
| | | | | | | | | | | | | | | | | | | | | | | | `type` became a soft keyword in Python 3.12. In that form, it is a statement that declares a type alias: # type_stmt ::= 'type' identifier [type_params] "=" expression type Point = tuple[float, float] To implement support for this, this change does three things: 1. adds a `pythonType` group (linked to `Type`) 2. matches `type` followed by an identifier as `pythonStatement` 3. continues to match `type` in other forms as `pythonBuiltin` Ref: - https://docs.python.org/3/reference/lexical_analysis.html#soft-keywords - https://docs.python.org/3/reference/simple_stmts.html#the-type-statement closes: vim/vim#18090 https://github.com/vim/vim/commit/99964e2ea704465f25207c519fefb2bb6d6931bb Co-authored-by: Jon Parise <jon@indelible.org>
* vim-patch:2f7e4eb: runtime(python): optimize pythonSync patternzeertzjq2025-08-20
| | | | | | | | | | | Order the keywords by expected frequency: "def" and "class" are assumed to be more likely than "async def" in the majority of Python code. closes: vim/vim#18032 https://github.com/vim/vim/commit/2f7e4eb335df389d73aaeb2ff6879b233c1a293f Co-authored-by: Jon Parise <jon@indelible.org>
* vim-patch:1ee1d9b: runtime(python): highlight "self" and "cls" in syntax ↵zeertzjq2025-08-14
| | | | | | | | | | | | | | | | script (#35328) These are special names by convention, and giving them distinct highlighting is a nice visual clue (using Identifier by default). This group is named "pythonClassVar" to match the name used by python-syntax. Some third-party color schemes are aware of this name and customized their colors accordingly. closes: vim/vim#17968 https://github.com/vim/vim/commit/1ee1d9b43da37b157a91662a312415e4db400ba9 Co-authored-by: Jon Parise <jon@indelible.org>
* vim-patch:dba9eb4: runtime(python): Also sync syntax at 'async def' (#35309)zeertzjq2025-08-12
| | | | | | | | | | | | | | A file containing only async functions (`async def func()`) wouldn't previously match the pythonSync pattern. Also, this pattern only matches at the beginning of the line, so it won't ever match method definitions (which are indented within class scopes). Update the comment accordingly. closes: vim/vim#17963 https://github.com/vim/vim/commit/dba9eb46e622efe39331b75d0c57c5d8b61b526f Co-authored-by: Jon Parise <jon@indelible.org>
* vim-patch:a94a055: runtime(python): Highlight f-string replacement fields in ↵zeertzjq2025-08-11
| | | | | | | | | | | | | | | | | | | | | | Python Highlight f-string replacement fields, including - Comments - Debugging flags - Conversion fields - Format specifications - Delimiters Syntax inside fields will be addressed in a separate commit. related: vim/vim#10734 related: vim/vim#14033 closes: vim/vim#17784 https://github.com/vim/vim/commit/a94a0555d911da0d3bcd7e91d76c8e8ef03d9b0e Co-authored-by: Rob B <github@0x7e.net>
* vim-patch:48b7eb1: runtime(python): Highlight classes as structureszeertzjq2025-08-11
| | | | | | | | | | | | Class and function definitions previously shared a single highlight group (pythonFunction). This change gives classes their own highlight group (pythonClass) that's linked to Structure. closes: vim/vim#17856 https://github.com/vim/vim/commit/48b7eb1ceb16527640ce5853d876c432d7342532 Co-authored-by: Jon Parise <jon@indelible.org>
* vim-patch:b7fc24d: runtime(python): Highlight f-strings in PythonChristian Clason2025-07-18
| | | | | | | | | | fixes: vim/vim#10734 fixes: vim/vim#14033 closes: vim/vim#17767 https://github.com/vim/vim/commit/b7fc24d3a3d21ccf1461c703eb7ff07ef3994c54 Co-authored-by: Rob B <github@0x7e.net>
* vim-patch:a24f5be: runtime(python): highlight bytes in pythonChristian Clason2025-07-15
| | | | | | | | | | | | | - Highlight bytes literals - Do not highlight Unicode escape sequences in bytes literals fixes: vim/vim#14033 fixes: vim/vim#17726 closes: vim/vim#17728 https://github.com/vim/vim/commit/a24f5be86d895981cb84266f98bae9f14407264b Co-authored-by: Rob B <github@0x7e.net>
* vim-patch:6f85cec: runtime(python): update rendering of Unicode named ↵Christian Clason2025-07-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | literals in syntax script This change: * enforces that the alias starts with a letter * allows the other words in an alias to be separated by either a space or a hyphen, but not both or double separators * allows only a letter after space, possibly followed by letters or digits * allows both letters and digits after a hyphen Tested with: a = '\N{Cyrillic Small Letter Zhe} is pronounced as zh in pleasure' b = '\N{NO-BREAK SPACE} is needed here' # ... other tests here r = '\N{HENTAIGANA LETTER E-1} is a Japanese hiragana letter archaic ye' s = '\N{CUNEIFORM SIGN NU11 TENU} is a correction alias' t = '\N{RECYCLING SYMBOL FOR TYPE-1 PLASTICS} base shape is a triangle' print(a) print(b) print(r) print(s) print(t) The tests confirm the behavior and are selected from real Unicode tables/aliases to check these combinations based on the specification. fixes: vim/vim#17323 closes: vim/vim#17735 https://github.com/vim/vim/commit/6f85cec4fbc1d1261c67a339a11792dd8f2efd14 Co-authored-by: Zvezdan Petkovic <zpetkovic@acm.org>
* vim-patch:71badf9547e8 (#23285)Christian Clason2023-04-23
| | | | | | | Update runtime files https://github.com/vim/vim/commit/71badf9547e8f89571b9a095183671cbb333d528 Co-authored-by: Bram Moolenaar <Bram@vim.org>
* vim-patch:partial:dd60c365cd26 (#22437)Christian Clason2023-02-28
| | | | | | | | | | | 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()`)
* vim-patch:2ecbe53f452e (#19577)Christian Clason2022-07-30
| | | | Update runtime files https://github.com/vim/vim/commit/2ecbe53f452e92e941aff623f6a0b72f80e43d07
* vim-patch:0e6adf8a29d5 (#16682)Christian Clason2021-12-16
| | | | Update runtime files https://github.com/vim/vim/commit/0e6adf8a29d5c2c96c42cc7157f71bf22c2ad471
* vim-patch:9faec4e3d439Jan Edmund Lazo2021-05-02
| | | | | | | Update runtime files. https://github.com/vim/vim/commit/9faec4e3d439968e21ad74e917aebb289df8f849 Omit vim9.
* vim-patch:b4ada79aa7d0Justin M. Keyes2017-04-29
| | | | | | | | Runtime file updates. https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59 Closes #5055
* vim-patch:d07969093a9bJustin M. Keyes2017-04-28
| | | | | | Updated runtime files. https://github.com/vim/vim/commit/d07969093a9b3051511c478d71c36de6fc33c0d6
* vim-patch:f37506f60f87Justin M. Keyes2017-04-28
| | | | | | Updated runtime files. Remove HiLink commands. https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
* vim-patch:89bcfda6834aJustin M. Keyes2017-04-28
| | | | | | Updated runtime files. Remove version checks for Vim older than 6.0. https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
* vim-patch:e4a3bcf28d92Justin M. Keyes2017-04-19
| | | | | | Updated runtime files. Add Scala files. https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
* vim-patch:6f1d9aShougo Matsushita2017-01-02
| | | | | | Updated runtime files. https://github.com/vim/vim/commit/6f1d9a096bf22d50c727dca73abbfb8e3ff55176
* vim-patch:77cdfd1James McCoy2016-07-08
| | | | | | | | | | | | Updated runtime files. https://github.com/vim/vim/commit/77cdfd10382e01cc51f4ba1a9177032351843151 Ignore changes to: * doc/channel.txt, doc/eval.txt: Channel related docs * doc/options.txt: GUI related docs * doc/tags: Generated at build time * doc/todo.txt: Irrelevant for Neovim
* vim-patch:ca63501David Barnett2016-04-18
| | | | | | Update various runtime files. https://github.com/vim/vim/commit/ca63501fbcd1cf9c8aa9ff12c093c95b62a89ed7
* vim-patch:f913281watiko2016-03-29
| | | | | | Updated and new runtime files. https://github.com/vim/vim/commit/f91328100db34996ed7e7a800bed0a30ff0890dd
* vim-patch:541f92 #4173David Barnett2016-02-07
| | | | | | Updated runtime files. https://github.com/vim/vim/commit/541f92
* runtime: fix for python highlighting #3154Victor Adam2015-08-31
| | | | | | | """\"""" was highlighted incorrectly. The fix is simply adding skip=+\\["']+ to the syntax of triple-quoted strings. Closes #3151
* re-integrate runtime/ vim-patch:0 #938Justin M. Keyes2014-07-29
Vim runtime files based on 7.4.384 / hg changeset 7090d7f160f7 Excluding: Amiga icons (*.info, icons/) doc/hangulin.txt tutor/ spell/ lang/ (only used for menu translations) macros/maze/, macros/hanoi/, macros/life/, macros/urm/ These were used to test vi compatibility. termcap "Demonstration of a termcap file (for the Amiga and Archimedes)" Helped-by: Rich Wareham <rjw57@cam.ac.uk> Helped-by: John <john.schmidt.h@gmail.com> Helped-by: Yann <yann@yann-salaun.com> Helped-by: Christophe Badoit <c.badoit@lesiteimmo.com> Helped-by: drasill <github@tof2k.com> Helped-by: Tae Sandoval Murgan <taecilla@gmail.com> Helped-by: Lowe Thiderman <lowe.thiderman@gmail.com>