0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00
Commit Graph

1310 Commits

Author SHA1 Message Date
Bjoern Foersterling
11bde1f169 runtime(sh): refactored sh.vim syntax script
- unified bashStatement, kshStatement and shStatement as much as
  possible
- separated builtin commands from external programs
- cleaned up kornshell flavor logic
- fixed alias syntax highlighting
- added test for bash alias syntax highlighting
- removed daemon keyword

closes: #18355

Signed-off-by: Bjoern Foersterling <bjoern.foersterling@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-23 19:48:09 +00:00
Doug Kearns
da5b6007fb runtime(vim): Update base syntax, match :terminal command
Match the full :terminal command syntax.

closes: #18367

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-23 18:31:34 +00:00
Doug Kearns
b1446dfd23 runtime(vim): Update base syntax, match :wincmd
Match the full :wincmd command syntax.

Allow for oneline assignment to Vim9 variables named winc[md].

Fixes #18368.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-23 18:24:53 +00:00
Andis Spriņķis
841becdc2d runtime(lf): update syntax to support lf version r38
Adds the lf release 38 specific syntax highlighting changes.

From the PR andis-sprinkis/lf-vim#24 by @CatsDeservePets

closes: #18342

Signed-off-by: Andis Spriņķis <andis@sprinkis.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-20 14:36:03 +00:00
zeertzjq
e8b0e926d0 runtime(config): fix inconsistent group name
related: #18292

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-18 20:19:02 +00:00
Christian Brabandt
6fd9dac992 runtime(log): highlight Java Errors
closes: #18315

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-18 19:37:10 +00:00
Doug Kearns
57d243e27d runtime(vim): Update base syntax, fix indented Vim9 :redir highlighting
Include post operator whitespace in the Vim9 variable assignment
lookahead so that "redir =>" doesn't match as an assignment.

fixes: #18319
closes: #18323

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-18 19:28:18 +00:00
Shawon
115b5338da runtime(kitty): Fix typo in syntax file for kitty
closes: #18312

Signed-off-by: Shawon <mdmoinulhossainshawon@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-16 19:25:31 +00:00
Christian Brabandt
b2113e511f runtime(kitty): fix typo in syntax script
related: #18280

Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-15 20:38:43 +00:00
Damien Lejay
8801c9db2e runtime(m4): Improve parameters highlighting in syntax script
closes: #18306

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-15 19:59:58 +00:00
Jon Parise
817e4d3ee6 patch 9.1.1764: filetype: CODEOWNERS file not recognized
Problem:  filetype: CODEOWNERS file not recognized
Solution: Detect CODEOWNERS file as codeowners filetype, include a
          syntax and filetype plugin (Jon Parise).

CODEOWNERS files define code ownership rules for GitHub-hosted (and
other) repositories. The syntax is similar to 'gitignore' files but
differs in enough ways to warrant its own filetype.

References:
- https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

closes: #18299

Signed-off-by: Jon Parise <jon@indelible.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-15 19:35:47 +00:00
Shawon
a946ccf5ff patch 9.1.1763: filetype: kitty config files are not recognized
Problem:  filetype: kitty config files are not recognized
Solution: Detect */kitty/*.conf as kitty filetype, include a syntax
          script (Shawon).

closes: #18280

Signed-off-by: Shawon <mdmoinulhossainshawon@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-15 19:10:12 +00:00
Damien Lejay
1e7a288cd3 runtime(config): mark unportable += as an error
closes: #18292

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-14 10:54:33 -04:00
Mao-Yining
b8970b43cd patch 9.1.1755: filetype: generic log files are not recognized
Problem:  filetype: generic log files are not recognized
Solution: Detect *.log files as log filetype, include simple log syntax
          script (Mao-Yining).

closes: #18285

Co-authored-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Mao-Yining <mao.yining@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-14 03:59:34 -04:00
Doug Kearns
15070eee2f runtime(python): Update syntax, fix pythonEllipsis pattern
fixes: #18263
closes: #18264

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-11 13:54:51 -04:00
Jon Parise
77cfc49060 runtime(python): highlight ellipsis literals
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: #18107

Signed-off-by: Jon Parise <jon@indelible.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-08 16:29:53 -04:00
Amelia Clarke
6d68508e62 runtime(hare): update for Hare 0.25.2
closes: #18222

Signed-off-by: Amelia Clarke <selene@perilune.dev>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-08 15:30:41 -04:00
Doug Kearns
6bb16d2cee runtime(python): Update syntax file, fix f-string float 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: #18220

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-08 15:27:30 -04:00
Girish Palya
fa6fd41a94 patch 9.1.1742: complete: preinsert does not work well with preinsert
Problem:  complete: preinsert does not work well with preinsert
Solution: Make "preinsert" completeopt value work with autocompletion
          (Girish Palya)

This change extends Insert mode autocompletion so that 'preinsert' also
works when 'autocomplete' is enabled.

Try: `:set ac cot=preinsert`

See `:help 'cot'` for more details.

closes: #18213

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-08 15:23:29 -04:00
Damien Lejay
1ed2ff77d8 runtime(m4): Remove m4Type and leftover m4Function in syntax script
closes: #18223

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-07 10:02:43 +02:00
Doug Kearns
6505dc69d3 runtime(nu): Add new Nushell runtime files
See: https://github.com/elkasztano/nushell-syntax-vim

Thanks to Pete Cruz (@Petesta) for promoting this addition.

closes: #18208

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-06 19:31:00 +02:00
Damien Lejay
efb913a4f5 runtime(m4): Remove m4Function
closes: #18211

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-06 15:16:06 +02:00
Damien Lejay
510ca80c58 runtime(m4): Improve comments, distinguish them from #-lines
closes: #18200

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-05 17:55:12 +02:00
Rob B
f1212a7b45 runtime(python): Do not match contained identifiers as pythonType
related: #17962
closes: #18206

Signed-off-by: Rob B <github@0x7e.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-05 16:58:35 +02:00
Rob B
d2b28ddfc2 runtime(python): add syntax support inside f-strings
fixes: #14033
closes: #17962

Signed-off-by: Rob B <github@0x7e.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-05 11:28:47 +02:00
Damien Lejay
f165798184 runtime(m4): update syntax script
This change does the following to the M4 syntax script:

- In M4 there are no "strings" in the usual sense. Instead, M4 has
  quotes, but the text inside a quoted region is rescanned just like
  outside, and quotes can be nested.
- The old m4String region was misleading and removed. A new m4Quoted
  region reflects proper quoting semantics.
- Removed a duplicate highlight rule.
- Fixed a typo in a highlight group name (m4builtin → m4Builtin).
- Added a reference link to the POSIX M4 specification.
- Removed outdated maintainer URL.

closes: #18192

Signed-off-by: Damien Lejay <damien@lejay.be>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-09-02 21:06:35 +02:00
Aliaksei Budavei
71149dfec5 runtime(java): Dismiss "g:markdown_fenced_languages" for Java buffers
No support is provided or planned for language recognition
in code snippets of documentation comments.  Requesting to
load arbitrary syntax plugins with the aid of the concerned
variable is therefore wasteful in general and erroneous when
paired languages ":syn-include" one another without taking
steps to manage circularity.

related: #17308
related: #17220
closes: #18172

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-31 19:16:14 +02:00
Doug Kearns
6f97624e11 runtime(vim): Update base syntax, fix Vim9 :for loop variable highlighting
Highlight the iteration variable's type in Vim9 :for {var} loops.

Reported by Aliaksei Budavei.

fixes: #17961
closes: #18163

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-31 19:13:32 +02:00
Doug Kearns
7239d95bf2 runtime(vim): Update base syntax, match :defer command argument
closes: #18159

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-29 18:07:11 +02:00
Foxe Chen
1f51bbc3b9 patch 9.1.1703: Cannot react to terminal OSC responses
Problem:  Cannot react to terminal OSC responses
Solution: Allow TermResponseAll to be triggered by Terminal OSC
          responses (Foxe Chen)

fixes: #14995
closes: #17975

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-27 21:15:47 +02:00
Christian Brabandt
7f380259cf runtime(vim): update vim syntax generator for patch v9.1.1692
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-27 19:24:49 +02:00
James McCoy
b760062897 runtime(debversions): Move bullseye, focal, and oracular to "unsupported"
These versions have exited their standard support term as of
- bullseye: 2024-08-14
- focal: 2025-05
- oracular: 2025-07-10

closes: #18134

Signed-off-by: James McCoy <jamessan@jamessan.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-27 18:03:04 +02:00
Andis Spriņķis
3571388ded runtime(lf): update syntax to support lf version r37
Adds the lf release 37 specific syntax highlighting changes.

From the PR andis-sprinkis/lf-vim#23 by @CatsDeservePets

closes: #18115

Signed-off-by: Andis Spriņķis <andis@sprinkis.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-26 00:02:01 +02:00
Jon Parise
99964e2ea7 runtime(python): support 'type's soft keyword form
`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: #18090

Signed-off-by: Jon Parise <jon@indelible.org>
Signed-off-by: Zvezdan Petkovic <zpetkovic@acm.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-24 12:31:08 +02:00
Kevin Pulo
e06d81fe67 runtime(sh): add syntax highlighting support for ${ cmd;} and ${|cmd;}
bash 5.3 (released July 2025) added support for ${ cmd;} and
${|cmd;} style command substitution, which is similar (but not
identical) to ksh/mksh.

closes: #18084

Signed-off-by: Kevin Pulo <kevin.pulo@mongodb.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-23 17:07:44 +02:00
Girish Palya
69a337edc1 patch 9.1.1672: completion: cannot add timeouts for 'cpt' sources
Problem:  completion: cannot add timeouts for 'cpt' sources
          (Evgeni Chasnovski)
Solution: Add the 'autocompletetimeout' and 'completetimeout' options
          (Girish Palya)

fixes: #17908
closes: #17967

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-23 16:20:03 +02:00
Radu Dineiu
f66674cf42 runtime(fstab): Added mtab support to fstab syntax.
closes: #18074

Signed-off-by: Radu Dineiu <radu.dineiu@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-23 13:47:51 +02:00
Foxe Chen
5734afebab patch 9.1.1666: no support for terminal primary device attributes
Problem:  no support for terminal primary device attributes
Solution: Add support for detecting the DA1 response from the terminal,
          add the v:termda1 variable and the 't_Ms' option for the
          OSC 52 command format (Foxe Chen)

closes: #18033

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-23 06:00:23 -04:00
Ayan Banerjee
014d50df80 runtime(systemverilog): Add syntax highlighting for 1800-2023 block strings
closes: #18056

Signed-off-by: Ayan Banerjee <ayanbanrj@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-20 22:19:04 +02:00
Foxe Chen
96b2154b73 patch 9.1.1651: Cannot use clientserver over socket
Problem:  Cannot use clientserver over Unix domain socket
Solution: Implement socketserver functionality (Foxe Chen).

fixes: #3509
closes: #17839

Signed-off-by: Foxe Chen <chen.foxe@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-18 21:40:40 +02:00
Jon Parise
2f7e4eb335 runtime(python): optimize pythonSync pattern
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: #18032

Signed-off-by: Jon Parise <jon@indelible.org>
Signed-off-by: Zvezdan Petkovic <zpetkovic@acm.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-18 21:06:50 +02:00
WuJunkai2004
0c4405a6b2 patch 9.1.1647: filetype: Cangjie files are not recognized
Problem:  filetype: Cangjie files are not recognized
Solution: Detect *.cj files as cangjie filetype, include a syntax plugin
          (WuJunkai2004)

This commit introduces a new syntax highlighting file for the Cangjie
programming language, includes 4 parts as required:
- The main syntax file: runtime/syntax/cangjie.vim
- The filetype detection rule in: runtime/filetype.vim
- The documentation update in: runtime/doc/syntax.txt
- Some menus

References:
- https://gitcode.com/Cangjie
- https://cangjie-lang.cn/

fixes: 18014
closes: #18027

Signed-off-by: WuJunkai2004 <wujunkai20041123@outlook.com>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-18 20:53:34 +02:00
Girish Palya
a09b1604d4 patch 9.1.1638: completion: not possible to delay the autcompletion
Problem:  completion: not possible to delay the autcompletion
Solution: add the 'autocompletedelay' option value (Girish Palya).

This patch introduces a new global option 'autocompletedelay'/'acl' that
specifies the delay, in milliseconds, before the autocomplete menu
appears after typing.

When set to a non-zero value, Vim waits for the specified time before
showing the completion popup, allowing users to reduce distraction from
rapid suggestion pop-ups or to fine-tune the responsiveness of
completion.

The default value is 0, which preserves the current immediate-popup
behavior.

closes: #17960

Signed-off-by: Girish Palya <girishji@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-16 18:04:04 +02:00
毛逸宁
3cee950fc9 runtime(diff): fix mixed translations in zh_CN
some translations confused zh_CN and zh_TW

Signed-off-by: 毛逸宁 <mao.yining@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-16 17:22:36 +02:00
Jon Parise
1ee1d9b43d runtime(python): highlight "self" and "cls" in syntax script
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: #17968

Signed-off-by: Jon Parise <jon@indelible.org>
Signed-off-by: Zvezdan Petkovic <zpetkovic@acm.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-13 22:37:31 +02:00
Jon Parise
dba9eb46e6 runtime(python): Also sync syntax at 'async def'
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: #17963

Signed-off-by: Jon Parise <jon@indelible.org>
Signed-off-by: Zvezdan Petkovic <zpetkovic@acm.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-11 20:33:33 +02:00
Rob B
a94a0555d9 runtime(python): Highlight f-string replacement fields in 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: #10734
related: #14033
closes: #17784

Signed-off-by: Rob B <github@0x7e.net>
Signed-off-by: Zvezdan Petkovic <zpetkovic@acm.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-10 10:35:31 +02:00
Jon Parise
48b7eb1ceb runtime(python): Highlight classes as structures
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: #17856

Signed-off-by: Jon Parise <jon@indelible.org>
Signed-off-by: Zvezdan Petkovic <zpetkovic@acm.org>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-10 10:32:41 +02:00
D. Ben Knoble
7270a5a843 runtime(racket): update Racket runtime files
This brings the upstream files to commit 9dc3bd3 (ftplugin: escape Vim
special characters when opening docs, 2025-08-09). Note that not all
upstream files are included.

closes: #17956

Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-09 23:38:07 +02:00
Aliaksei Budavei
7132935413 runtime(java): Manage byte limits for variable-width lookbehind assertions
Raise the byte limits from 80 to 120 for "javaFuncDef" and
"java*CommentTitle"; and support selecting other arbitrary
values with
------------------------------------------------------------
	let g:java_lookbehind_byte_counts = {
		\ 'javaMarkdownCommentTitle': 240,
	\ }
------------------------------------------------------------

for related groups of syntax definitions, referring to their
names with dictionary keys.

Over-80-Byte-Limit Lookbehind Examples:
https://raw.githubusercontent.com/openjdk/jdk/refs/tags/jdk-24%2B36/src/java.base/share/classes/sun/security/x509/NamedX509Key.java [Lines 43 & 44]
https://raw.githubusercontent.com/openjdk/jdk/refs/tags/jdk-24%2B36/src/jdk.compiler/share/classes/com/sun/tools/javac/util/GraphUtils.java [Line 154]

closes: #17921

Signed-off-by: Aliaksei Budavei <0x000c70@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2025-08-08 10:50:19 +02:00