summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/syntax/python.vim
AgeCommit message (Collapse)AuthorFiles
2026-03-12vim-patch:2cf18fc: runtime(python): Update syntax, improve pythonNumber ↵zeertzjq1
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>
2026-01-27vim-patch:632fd8b: runtime(python): Highlight built-in constants in Pythonzeertzjq1
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>
2025-12-04vim-patch:8d8c907: runtime(python): Highlight t-stringszeertzjq1
- 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>
2025-09-26vim-patch:900c747: runtime(python): fix 'type' syntax highlighting (#35918)zeertzjq1
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>
2025-09-12vim-patch:15070ee: runtime(python): Update syntax, fix pythonEllipsis ↵zeertzjq1
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>
2025-09-09vim-patch:77cfc49: runtime(python): highlight ellipsis literalszeertzjq1
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>
2025-09-09vim-patch:6bb16d2: runtime(python): Update syntax file, fix f-string float ↵zeertzjq1
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>
2025-09-06vim-patch:f1212a7: runtime(python): Do not match contained identifiers as ↵zeertzjq1
pythonType related: vim/vim#17962 closes: vim/vim#18206 https://github.com/vim/vim/commit/f1212a7b4554f2f544b581f7e819d6ef67c5e9ad Co-authored-by: Rob B <github@0x7e.net>
2025-09-06vim-patch:d2b28dd: runtime(python): add syntax support inside f-stringszeertzjq1
fixes: vim/vim#14033 closes: vim/vim#17962 https://github.com/vim/vim/commit/d2b28ddfc2a7350c2f63b75d06cc53d17b3a66ff Co-authored-by: Rob B <github@0x7e.net>
2025-08-24vim-patch:99964e2: runtime(python): support 'type's soft keyword formzeertzjq1
`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>
2025-08-20vim-patch:2f7e4eb: runtime(python): optimize pythonSync patternzeertzjq1
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>
2025-08-14vim-patch:1ee1d9b: runtime(python): highlight "self" and "cls" in syntax ↵zeertzjq1
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>
2025-08-12vim-patch:dba9eb4: runtime(python): Also sync syntax at 'async def' (#35309)zeertzjq1
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>
2025-08-11vim-patch:a94a055: runtime(python): Highlight f-string replacement fields in ↵zeertzjq1
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>
2025-08-11vim-patch:48b7eb1: runtime(python): Highlight classes as structureszeertzjq1
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>
2025-07-18vim-patch:b7fc24d: runtime(python): Highlight f-strings in PythonChristian Clason1
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>
2025-07-15vim-patch:a24f5be: runtime(python): highlight bytes in pythonChristian Clason1
- 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>
2025-07-13vim-patch:6f85cec: runtime(python): update rendering of Unicode named ↵Christian Clason1
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>
2023-04-23vim-patch:71badf9547e8 (#23285)Christian Clason1
Update runtime files https://github.com/vim/vim/commit/71badf9547e8f89571b9a095183671cbb333d528 Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-02-28vim-patch:partial:dd60c365cd26 (#22437)Christian Clason1
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()`)
2022-07-30vim-patch:2ecbe53f452e (#19577)Christian Clason1
Update runtime files https://github.com/vim/vim/commit/2ecbe53f452e92e941aff623f6a0b72f80e43d07
2021-12-16vim-patch:0e6adf8a29d5 (#16682)Christian Clason1
Update runtime files https://github.com/vim/vim/commit/0e6adf8a29d5c2c96c42cc7157f71bf22c2ad471
2021-05-02vim-patch:9faec4e3d439Jan Edmund Lazo1
Update runtime files. https://github.com/vim/vim/commit/9faec4e3d439968e21ad74e917aebb289df8f849 Omit vim9.
2017-04-29vim-patch:b4ada79aa7d0Justin M. Keyes1
Runtime file updates. https://github.com/vim/vim/commit/b4ada79aa7d0d1e5da3a659b1a203d7cae9f7f59 Closes #5055
2017-04-28vim-patch:d07969093a9bJustin M. Keyes1
Updated runtime files. https://github.com/vim/vim/commit/d07969093a9b3051511c478d71c36de6fc33c0d6
2017-04-28vim-patch:f37506f60f87Justin M. Keyes1
Updated runtime files. Remove HiLink commands. https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
2017-04-28vim-patch:89bcfda6834aJustin M. Keyes1
Updated runtime files. Remove version checks for Vim older than 6.0. https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
2017-04-19vim-patch:e4a3bcf28d92Justin M. Keyes1
Updated runtime files. Add Scala files. https://github.com/vim/vim/commit/e4a3bcf28d92d0bde9ca227ccb40d401038185e5
2017-01-02vim-patch:6f1d9aShougo Matsushita1
Updated runtime files. https://github.com/vim/vim/commit/6f1d9a096bf22d50c727dca73abbfb8e3ff55176
2016-07-08vim-patch:77cdfd1James McCoy1
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
2016-04-18vim-patch:ca63501David Barnett1
Update various runtime files. https://github.com/vim/vim/commit/ca63501fbcd1cf9c8aa9ff12c093c95b62a89ed7
2016-03-29vim-patch:f913281watiko1
Updated and new runtime files. https://github.com/vim/vim/commit/f91328100db34996ed7e7a800bed0a30ff0890dd
2016-02-07vim-patch:541f92 #4173David Barnett1
Updated runtime files. https://github.com/vim/vim/commit/541f92
2015-08-31runtime: fix for python highlighting #3154Victor Adam1
"""\"""" was highlighted incorrectly. The fix is simply adding skip=+\\["']+ to the syntax of triple-quoted strings. Closes #3151
2014-07-29re-integrate runtime/ vim-patch:0 #938Justin M. Keyes1
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>