Commit Graph

10230 Commits

Author SHA1 Message Date
zeertzjq
93a8acb1b8 vim-patch:9.2.0033: filetype: sh filetype used for env files
Problem:  filetype: sh filetype used for env files
Solution: Detect *.env and .env.* files as env filetype,
          detect .envrc and .envrc.* as sh filetype,
          include a simple env syntax script (DuckAfire)

Previously, .env files were handled by the shell syntax. While
functional, this limited the ability to support specific .env
implementations, such as CodeIgniter4 which allows dots in keys
(e.g., "foo.bar=0").

The new dedicated 'env' filetype and syntax script improves legibility
and prevents highlighting from breaking when encountering spaces.
Currently, the syntax does not support indentation; fields, variables,
and comments must start at the beginning of the line.

closes: vim/vim#19260

d0fa375629

Co-authored-by: DuckAfire <155199080+duckafire@users.noreply.github.com>
2026-02-20 09:26:07 +08:00
zeertzjq
595b4cc48e vim-patch:4611f7b: runtime(apache): Add 'SSLVHostSNIPolicy' declaration to syntax script
The declaration 'SSLVHostSNIPolicy' has bee introduced in version 2.4.66.

closes: vim/vim#19452

4611f7b656

Co-authored-by: Michael Osipov <michael.osipov@innomotics.com>
2026-02-20 09:18:13 +08:00
zeertzjq
c67248988b vim-patch:342ae5f: runtime(progress): Use setlocal for expandtab
The Progress syntax file gained `set expandtab` in 4c3f536f4 (updated
for version 7.0d01, 2006-04-11). The Progress language itself doesn't
distinguish between tabs and spaces for indentation, so this seems like
something that should be left to user preference; but the setting is
accompanied by the comment "The Progress editor doesn't cope with tabs
very well", so there may be reason to keep it.

However, using `set` means that any new buffers created after editing a
Progress file will also have `expandtab` turned on, which is likely
contrary to a user's expectations. We should use `setlocal` instead to
avoid this.

closes: vim/vim#19458

342ae5f8aa

Co-authored-by: Daniel Smith <daniel@rdnlsmith.com>
2026-02-20 09:17:57 +08:00
zeertzjq
c78e276881 vim-patch:9.2.0027: filetype: yara files are not recognized
Problem:  filetype: yara files are not recognized
Solution: Detect *.yara and *.yar files as yara filetype
          (Thomas Dupuy).

Reference:
- https://github.com/VirusTotal/yara
- https://github.com/VirusTotal/yara-x

closes: vim/vim#19460

7d93ae57f0

Co-authored-by: Thomas Dupuy <thom4s.d@gmail.com>
2026-02-20 09:17:46 +08:00
zeertzjq
08f4811061 fix(treesitter): :InspectTree wrong title for non-relative path #37965
Problem:  :InspectTree sets wrong title for file with non-relative path.
Solution: Use full path if relpath() returns nil.
2026-02-19 12:05:48 -05:00
Evgeni Chasnovski
9567fb0507 fix(defaults): silent gx if no textDocument/documentLink support #37969
Problem: If buffer has attached LSP servers and none of them supports
  `textDocument/documentLink` method, typing `gx` results in a warning
  about that.

Solution: Explicitly check that at least one server supports the target
  method before making the LSP request.
2026-02-19 06:59:00 -05:00
zeertzjq
e98a6979ee vim-patch:9.2.0025: filetype: cshtml incorrectly recognized (#37957)
Problem:  filetype: cshtml incorrectly recognized, razor files are not
          recognized
Solution: Detect *.cshtml and *.razor files as razor filetype
          (tris203)

Reference:
https://learn.microsoft.com/en-us/aspnet/core/mvc/views/razor?view=aspnetcore-10.0

closes: vim/vim#19207

68dbb58d51

Co-authored-by: tris203 <admin@snappeh.com>
2026-02-19 02:46:27 +00:00
Maria Solano
c3589753a0 fix(lsp): add vim.deprecate call to vim.lsp.with (#37960) 2026-02-18 18:16:03 -08:00
zeertzjq
6877fef972 vim-patch:89712b9: runtime(ccomplete): handle structs from tags file (#37956)
fixes: vim/vim#7292

89712b9f0e

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-02-19 00:18:55 +00:00
Maria Solano
6fe68abdf5 fix(lsp): use entire line as completion word (#37949) 2026-02-18 11:40:34 -08:00
Christian Clason
3bdebfb87f feat(defaults): don't enable treesitter query linter
This was added before there was a dedicated language server for
tree-sitter queries. Now that https://github.com/ribru17/ts_query_ls
exists, this is a better option in every regard (and up to now
required manually disabling the builtin linter to avoid duplicate
diagnostics and performance issues).
2026-02-18 18:06:35 +01:00
Justin M. Keyes
abfe6c9ef7 feat(logging): rename ".nvimlog" => "nvim.log" #37935
- Rename ".nvimlog" to "nvim.log"
  - doesn't need to be "hidden"/dotfile
  - ".log" extension helps with filetype detection
- Also rename "nvim/log" => "nvim/nvim.log"
2026-02-18 11:58:34 -05:00
Olivia Kinnear
6bb6b47933 fix(lsp): wait to display exit message #37925 2026-02-18 03:03:20 -05:00
Rahul Yedida
9492df027d fix(defaults): 'guifont' "monospace" fallback, trim spaces #37930
Problem:
Some UI clients break if space follows the comma in 'guifont' items.
Also the new 'guifont' default may cause problems if none of the fonts are found.

Solution:
Remove trailing whitespace. 
Add a "monospace" fallback which `fontconfig` can resolve on *nix systems.
2026-02-18 01:57:59 -05:00
luukvbaal
29a46a11aa fix(ui2): don't change configured message target implicitly #37924
Problem:  Implicitly setting message target when 'cmdheight' changes.
Solution: Just use the user configured target. Support "cmd" target
          with 'cmdheight' set to 0.
2026-02-17 13:12:49 -05:00
luukvbaal
e268760e46 feat(ui2): show active paging keys in dialog float title #37919
Problem:  Paging keys being consumed without obvious indicator
          in the dialog window can be surprising.
Solution: Display a hint with paging keys in the dialog window title
          when paging is active. Recognize <Esc> as mapping to stop
          paging.
2026-02-17 07:28:56 -05:00
Christian Clason
dcbe5bdd96 feat(ftplugin): treesitter default highlighting for markdown 2026-02-17 10:35:19 +01:00
luukvbaal
16495e6863 fix(ui2): only set dialog on_key callback once #37905
Problem:  vim.on_key() called for each message while cmdline is open.
          Cursor is on a seemingly random column when pager is entered.
          Entering the pager while the cmdline is expanded can be more
          convenient than pressing "g<".
          Pager window is unnecessarily clamped to half the shell height.
          Setting 'laststatus' while pager is open does not adjust its
          dimensions.
Solution: Only call vim.on_key() once when dialog window is opened.
          Ensure cursor is at the start of the first message when
          entering the pager.
          Enter the pager window when "<CR>" is pressed while the
          cmdline is expanded.
          Don't clamp the pager window height.
          Set message windows dimensions when 'laststatus' changes.
2026-02-16 17:11:32 -05:00
Tristan Knight
13cf80deef fix(lsp): map all LSP methods to server capabilities (#37910) 2026-02-16 13:20:34 -08:00
Maria Solano
05bd4398c5 feat(lsp): support textDocument/documentLink (#37644) 2026-02-16 11:05:33 -08:00
Maria Solano
6e1745e96e feat(lua): support vim.Range:has(vim.pos) #37879 2026-02-16 11:05:38 -05:00
Rahul Yedida
249f305bbc feat(defaults): per-platform 'guifont' default #37175
Problem:
Font rendering and kerning are subpar in GUIs.

Solution:
Set default 'guifont' based on common CSS fonts per:
https://github.com/system-fonts/modern-font-stacks#monospace-code
2026-02-16 09:05:23 -05:00
zeertzjq
cbec4603a0 vim-patch:partial:9.1.1668: items() does not work for Blobs
Problem:  items() does not work for Blobs
Solution: Extend items() to support Blob
          (Yegappan Lakshmanan).

closes: vim/vim#18080

da34f84847

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2026-02-16 21:17:02 +08:00
zeertzjq
b51fc202ce vim-patch:3de7384: runtime(doc): Fix :help complete() example (#37891)
closes: vim/vim#18417

3de73844af

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-02-16 14:31:51 +08:00
zeertzjq
b8ec43a4a7 vim-patch:abac1c1: runtime(zip): use system() instead of :!
- ':!' is not stable, so use system() to get more consistent behaviour.
- Only warns when using 'pwsh'.
- Remove trailing spaces.

closes: vim/vim#19370

abac1c1aa6

Co-authored-by: Mao-Yining <mao.yining@outlook.com>
Co-Authored-by: @lxhillwind
2026-02-16 10:29:22 +08:00
zeertzjq
4c35d0d762 vim-patch:0435abf: runtime(fstab): Add cgroup2 to valid device types
closes: vim/vim#19403

0435abfaa1

Co-authored-by: Radu Dineiu <radu.dineiu@gmail.com>
2026-02-16 09:11:02 +08:00
zeertzjq
4b0654db25 vim-patch:3794d9b: runtime(vim): Error codes should not be highlighed with vim9CommentTitle
closes: vim/vim#19390

3794d9b33c

Co-authored-by: Peter Kenny <github.com@k1w1.cyou>
2026-02-16 09:11:02 +08:00
zeertzjq
fdf20f32ee vim-patch:c68e64d: runtime(sh): fix spurious nextgroup=shComment on shEscape
Remove `nextgroup=shComment` from the `shEscape` syntax pattern.
This was causing `#` characters after escape sequences inside
double-quoted strings to be misinterpreted as comments, breaking
highlighting for the rest of the file.

Add a test case for escaped characters followed by # in double quotes.

fixes:  vim/vim#19053
closes: vim/vim#19414

c68e64dac3

Co-authored-by: Bozhidar Batsov <bozhidar@batsov.dev>
2026-02-16 09:11:02 +08:00
Riley Bruins
4719b94443 feat(statusline): option to specify stacking highlight groups #37153
**Problem:** No easy way to stack highlight groups #35806.

**Solution:** Add a way to specify a new statusline chunk with a
highlight group that inherits from previous highlight attributes.

Also applies to tabline, etc.
2026-02-15 12:16:51 -05:00
Tim Pope
a1895f024a fix(lsp): support workspace/configuation with no section #27510
The [spec for `workspace/configuration`](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_configuration)
marks the `section` property of each item in `items` optional.
Therefore, I believe it violates the spec to skip over items without
a section, because then the length of the results won't match the length
of a valid `items` input. The spec does not elaborate on _what_ to
return in this case, but I don't think it would be controversial to say
that returning the full configuration, as done for an empty string, is
the most natural interpretation.

That empty string case, by the way, was initially [added in
response](5da124fc82)
to a real world implementation requesting it. I don't have a similar
real world implementation to point to for the omitted `section`, but
I would note that `getConfiguration()` from `vscode-languageserver-node`
[defaults to a request with no section](d859bb14d1/server/src/common/configuration.ts (L24-L26))
when called with no arguments. I surmise that this is intended as a way
to retrieve the full configuration.
2026-02-15 11:37:24 -05:00
phanium
5c4b64aae5 fix(lsp): wait for exit_timeout on quit #37597
Problem:
When quitting Nvim, LSP servers will not be force-stopped, even if
ClientConfig.exit_timeout is set to an integer.

    pkill emmylua_ls; VIMRUNTIME=runtime/ nvim --clean -u repro.lua repro.lua ; waitpid $(pgrep emmylua_ls)

    vim.lsp.config('foo', { cmd = { 'emmylua_ls' }, exit_timeout = 1000 })
    vim.lsp.enable('foo')
    vim.defer_fn(vim.cmd.quit, 500)

Solution:
On VimExit, wait up to `exit_timeout:integer` milliseconds for servers
to exit. Do this with an explicit `vim.wait()`, because the actual
force-stop is deferred, and won't be attempted if Nvim exits before
then.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
2026-02-15 07:33:49 -05:00
glepnir
fb6a2c964d docs: Lua error codes E970, E5107-E5116 #37577 2026-02-14 10:55:48 -05:00
Tristan Knight
b99cdd08de refactor(lsp): centralize provider capability resolution #37221
- Refactor LSP client to use unified provider-based capability lookup for
  diagnostics and other features.
- Introduce `_provider_value_get` to abstract capability retrieval,
  supporting both static and dynamic registrations.
- Update diagnostic handling and protocol mappings to leverage
  provider-centric logic.
2026-02-14 10:50:48 -05:00
Evgeni Chasnovski
539b8027a3 fix(pack): explicitly close confirmation window #37861
Problem: Executing `nvim_buf_delete()` does not guarantee that the
  window which shows the buffer is going to close after `:write` or
  `:quit`. In particular, if there is no listed buffer present.

Solution: Explicitly close the window that was created for confirmation
  buffer. Use `pcall` to catch cases when the window was already closed
  or when it is the last window.
2026-02-14 08:26:36 -05:00
Dmytro Pletenskyi
01666aae64 feat(diagnostic): fromqflist({merge_lines}) #37416
Problem:
`vim.diagnostic.fromqflist` ignores lines that are `item.valid == 0` (see
`getqflist`). Many qflists have messages that span multiple lines, which look
like this:

    collection/src/Modelling/CdOd/Central.hs|496 col 80| error: [GHC-83865]
    ||     • Couldn't match expected type: InstanceWithForm
    ||                                       (FilePath
    ||                                        -> SelectValidCdInstWithForm
    ...

calling `vim.diagnostic.fromqflist(vim.fn.getqflist)` gets a diagnostic message
like this:

    error: [GHC-83865]

only the first line is kept, but often, the remaing lines are useful as well.

Solution:
Introduce `merge_lines` option, which "squashes" lines from invalid qflist items
into the error message of the previous valid item, so that we get this
diagnostic message instead:

    error: [GHC-83865]
         • Couldn't match expected type: InstanceWithForm
                                           (FilePath
                                            -> SelectValidCdInstWithForm
2026-02-14 06:07:01 -05:00
Justin M. Keyes
0864939cc5 fix(restart): append -c <cmd> at end, drop -- [files…] #37846
Problem:
- `:restart <cmd>` prepends `-c <cmd>` before the original `-c` args (if
  any). So the original `-c` args may "override" it, which is
  surprising.
- Confusing logic: `v:argv` is partially prepared in `ex_docmd.c`, and
  then later `ui.c` skips other parts of it.

Current behavior is nonsense, for example this sequence:

    :restart echo "Hello"
    :restart +qall echo "Hello" | echo "World"

results in this v:argv:

    [
      'nvim'
      '-c'
      'echo "Hello" | echo "World"'
      '--embed'
      '-c'
      'echo "Hello"'
      ...
    ]

Whereas after this commit, v:argv is:

    [
      'nvim'
      '--embed'
      ...
      '-c'
      'echo "Hello" | echo "World"'
    ]

Solution:
- Append `-c <cmd>` at the _end_ of `v:argv`, not the start.
- Use a dummy placeholder `+:::` to mark where the "restart command"
  appears in `v:argv`.
- Do all `v:argv` preparation in `ex_docmd.c`. This simplifies `ui.c`.
- Drop `-- [files…]` from `v:argv` since it is probably more annoying
  than useful. (Users can use sessions to restore files on restart.)
2026-02-14 05:34:30 -05:00
Yochem van Rosmalen
b5ce7e74dc refactor(help): move local-additions to Lua #37831
Problem:
- ~200 line function of hard-to-maintain C code.
- Local Addition section looks messy because of the varying description
  formats.

Solution:
- Move code to Lua.
- Have a best-effort approach where short descriptions are right
  aligned, giving a cleaner look. Long descriptions are untouched.
2026-02-14 05:30:18 -05:00
zeertzjq
a17d39314d docs(lua): correct vim.wait() interval description (#37856)
Use the wording from the wait() Vimscript function.
2026-02-14 09:05:08 +08:00
zeertzjq
289695c14e vim-patch:48cee53: runtime(doc): Clarify :bd behaviour
closes: vim/vim#19389

48cee53615

Co-authored-by: Christian Brabandt <cb@256bit.org>
2026-02-14 07:59:51 +08:00
zeertzjq
97c39be164 vim-patch:10f5573: runtime(systemverilog): use correct matchit pattern for the covergroup block
A covergroup start with the "covergroup" keyword and ends with the
"endgroup" keyword. "group" is not even a reserved keyword in systemverilog.

Reference:
https://www.chipverify.com/systemverilog/systemverilog-covergroup-coverpoint#covergroup
https://github.com/MikePopoloski/slang/blob/master/docs/grammar.md#covergroup_declaration

closes: vim/vim#19393

10f5573672

Co-authored-by: TG <tarik.graba@telecom-paris.fr>
2026-02-14 07:59:51 +08:00
zeertzjq
d49fe235f7 vim-patch:dcc4175: runtime(go,gleam): Remove 'formatprg' from ftplugins
Effective use of 'formatprg' requires both an understanding of the
specific capabilities of the formatting tool and Vim's formatting
commands.  This is overly burdensome for some users.

Rather than address each complaint on a filetype by filetype basis,
remove 'formatprg' settings from all ftplugins.

It is expected that formatter plugins will be available in the near
future as a better solution. See vim/vim#17145 (Add "formatter" feature using
"compiler" as a template).

Note: 'formatprg' will be removed from older ftplugins after the release
of Vim 9.2. The setting was added to the go and gleam ftplugins during
the current development cycle and have not been included in a Vim
release.

See: vim/vim#18650 (rust.vim: stop setting formatprg to rustfmt)

closes: vim/vim#19108

dcc4175284

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2026-02-14 07:59:51 +08:00
zeertzjq
3432d87ce0 vim-patch:a39d7c2: runtime(sudoers): highlight usernames with hyphens, digits, underscores
The username/group/netgroup patterns used \l\+ which only matched
lowercase letters. Linux usernames commonly contain hyphens, digits,
and underscores (e.g. www-data, deploy01, test_user).

Update the pattern to \l[-a-z0-9_]* to allow matching the additional
characters "-_" and numbers.

fixes:  vim/vim#18963
closes: vim/vim#19396

a39d7c2617

Co-authored-by: Bozhidar Batsov <bozhidar@batsov.dev>
2026-02-14 07:59:51 +08:00
zeertzjq
6bc0b8ae87 feat(terminal): detect suspended PTY process (#37845)
Problem:  Terminal doesn't detect if the PTY process is suspended or
          offer a convenient way for the user to resume the process.
Solution: Detect suspended PTY process on SIGCHLD and show virtual text
          "[Process suspended]" at the bottom-left. Resume the process
          when the user presses a key.
2026-02-13 13:49:08 +00:00
zeertzjq
1ed064625c vim-patch:1cf38bf: runtime(css): Add missing numeric units (#37843)
- Add missing numeric units to css syntax script
  (baseline 2015, 2020, 2022, 2023, 2026):
    dvb, dvh, dvi, dvmax, dvmin, dvw ic,
    lvb, lvh, lvi, lvmax, lvmin, lvw, svb, svh,
    svi, svmax, svmin, svw, vb, vi, x, cap, lh,
    rlh, rcap, rch, rex, ric

closes: vim/vim#19325

1cf38bfebe

Co-authored-by: DuckAfire <155199080+duckafire@users.noreply.github.com>
2026-02-13 17:11:49 +08:00
zeertzjq
1a1690660e vim-patch:9bf9d43: runtime(doc): various netrw related corrections
closes: vim/vim#19391

9bf9d436ce

Co-authored-by: Peter Kenny <github.com@k1w1.cyou>
2026-02-13 16:39:18 +08:00
zeertzjq
937f64da70 vim-patch:partial:8ee0e0b: runtime(doc): Fix to two-space convention in user manual
closes: vim/vim#15802

8ee0e0b8e3

Co-authored-by: h-east <h.east.727@gmail.com>
2026-02-13 16:39:18 +08:00
zeertzjq
39d8a9c353 vim-patch:9.1.2146: filetype: cel files are not recognized (#37834)
Problem:  filetype: cel files are not recognized
Solution: Detect *.cel files as cel filetype (Stefan VanBuren).

Reference:
https://cel.dev/
e36c49febc/testing/src/test/resources/expressions/coverage_test_case/simple_expression.cel
d0d2dbabae/example.cel

closes: vim/vim#19381

fb5777fa20

Co-authored-by: Stefan VanBuren <svanburen@buf.build>
2026-02-13 08:34:00 +08:00
zeertzjq
844a683641 vim-patch:56033b9: runtime(sh): Fix some ksh-specific deficiencies in syntax script
- Amend syntax highlighting to allow for ksh93 discipline function names
  (e.g. 'foo.get()') and mksh's odd function naming idiosyncrasies
  (shNamespaceOne was introduced to enforce stricter naming rules for
  ksh93 namespaces).
- Remove 'bind' from ksh93 syntax (such a builtin has never been
  implemented in ksh93).
- 'xgrep' is only available in ksh93v- as an alternative way to
  invoke the builtin 'grep -X', so reflect that in the syntax
  highlighting.
- Forbid bash-style 'function name() {' syntax when highlighting
  ksh88 and ksh93 scripts.
- Fix bug causing ' ()' to be incorrectly validated in mksh scripts.
- Add the many ksh93/ksh2020 .sh.* variables to the list of special
  variables.
- Amend iskeyword to allow '.' so that '.sh.tilde.get' and such are
  valid function names/variable names. (For mksh functions starting
  with odd characters like '%' and '@' this would probably have too
  many bad side effects, so I've omitted such a change for that shell.)
- Add new syntax tests and regenerate syntax dump files

closes: vim/vim#19383

56033b9df3

Co-authored-by: Johnothan King <johnothanking@protonmail.com>
2026-02-13 08:29:18 +08:00
zeertzjq
ca701ad947 vim-patch:04c3c68: runtime(sshdconfig): Update syntax
We add new key exchange algorithms and new enums for PubkeyAuthOptions.

We also add new keywords from sshd_config.5 not present here and remove
keywords present here that are not present in the official
documentation, with the exception of those patched in by Debian and
Fedora, as well as ChallengeResponseAuthentication which is deprecated
but still functional.

closes: vim/vim#19347

04c3c6871e

Co-authored-by: Fionn Fitzmaurice <fionn@github.com>
2026-02-13 08:29:18 +08:00
zeertzjq
eaeb2419cf vim-patch:b27934b: runtime(django): add syntax support for partial
Add djangoStatement integrated in version 6. 'partialdef',
'endpartialdef', 'partial'.

[Template Reference: partial](https://docs.djangoproject.com/en/6.0/ref/templates/builtins/#partial)((introduced in Django 6.0)
and 'filter'.

closes: vim/vim#19386

b27934bf8b

Co-authored-by: tecis <67809811+tecis@users.noreply.github.com>
2026-02-13 08:29:18 +08:00