Commit Graph
9347 Commits
Author SHA1 Message Date
zeertzjqandRadu Dineiu 53802da38b vim-patch:f66674c: runtime(fstab): Added mtab support to fstab syntax.
closes: vim/vim#18074

https://github.com/vim/vim/commit/f66674cf429aa1fac79e522b45372d7e3d37a902

Co-authored-by: Radu Dineiu <radu.dineiu@gmail.com>
2025-08-24 20:08:15 +08:00
zeertzjqandGirish Palya 810a234978 vim-patch:9.1.1672: completion: cannot add timeouts for 'cpt' sources (#35447)
Problem:  completion: cannot add timeouts for 'cpt' sources
          (Evgeni Chasnovski)
Solution: Add the 'autocompletetimeout' and 'completetimeout' options
          (Girish Palya)

fixes: vim/vim#17908
closes: vim/vim#17967

https://github.com/vim/vim/commit/69a337edc15a6c6eba6f16d2f3b7b223a149a938

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-24 13:16:55 +08:00
Riley Bruins 29c5559ce1 fix(treesitter): show capture-level priorities in :Inspect #35443 2025-08-23 12:01:38 -07:00
zeertzjqandHirohito Higashi 1c0465bec6 vim-patch:5ca1ea8: runtime(doc): Tweak documentation style
closes: vim/vim#18078

https://github.com/vim/vim/commit/5ca1ea83ad79c8d1ebd25e61c91f1199c9bc4f09

Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
2025-08-23 20:40:59 +08:00
zeertzjqandGirish Palya 4019d3050d vim-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: vim/vim#17960

https://github.com/vim/vim/commit/a09b1604d4fe7516d87fbcbf2ffd2dc484799b23

N/A patch: vim-patch:9.1.1641: a few compiler warnings are output

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-23 20:40:58 +08:00
Gregory Anders 586b1b2d9b feat(tui): add nvim_ui_send (#35406)
This function allows the Nvim core to write arbitrary data to a TTY
connected to a UI's stdout.
2025-08-22 15:05:43 -05:00
Justin M. Keyes 5d8e870c11 Merge #35429 vim.pack adjustments 2025-08-22 14:35:41 -04:00
bfredl ec8a0c7340 fix(build): workaround errors in zig build due to stale cache
addDirectoryArg with a source dir is not enough to depend on changes
to invidiual files. as a workaround, mark this step as having
side-effects (always being run) for now.
2025-08-22 19:10:43 +02:00
Evgeni Chasnovski 1ffaaa06c5 docs(pack): document $XDG_DATA_HOME/nvim/site presence in 'packpath'
Problem: Some use cases might lead to `vim.pack.add()` failing to
`:packadd` a plugin because of missing entry in 'packpath'. Like with
`nvim --clean` or manually setting `$XDG_DATA_HOME` during startup.

Solution: Document it. A more proactive approach can be ensuring correct
'packpath' entry, but it is currently somewhat verbose to do (due to
having to adjust for Windows using `\` in 'packpath' entries).
2025-08-22 13:41:36 +03:00
Evgeni Chasnovski 92e7d5eaf2 perf(pack): reduce number of 'opt/' directory computations 2025-08-22 13:00:30 +03:00
zeertzjqandAyan Banerjee 12b6f65283 vim-patch:014d50d: runtime(systemverilog): Add syntax highlighting for 1800-2023 block strings (#35425)
closes: vim/vim#18056

https://github.com/vim/vim/commit/014d50df80d71ab0adcf9b2e649469945dd3bbc2

Co-authored-by: Ayan Banerjee <ayanbanrj@gmail.com>
2025-08-22 09:26:47 +08:00
Igor Lacerda 8e48c02061 fix(lsp): handle array with empty string when checking empty hover (#35423) 2025-08-21 17:15:56 -07:00
c522cb0e96 feat(pack): support user-defined data in plugin spec #35360
Problem:
The load function in opts was difficult to use if you wished to
customize based on the plugin being loaded.

You could get the name, but without some way to mark a spec, that was of
limited usefulness unless you wanted to hardcode a list of names in the
function, or write a wrapper around the whole thing

Solution:
Allow users to provide an arbitrary data field in plugin specs so that
they may receive info as to how to handle that plugin in load, get() and
events, and act upon it

Co-authored-by: BirdeeHub <birdee@localhost>
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
2025-08-21 10:08:29 -07:00
luukvbaal 9467731865 feat(extui): support paging in the dialog window (#35310)
Problem:  Unable to see e.g. `inputlist()` prompts that exceed the dialog
          window height.
          Multi-line prompts are not handled properly, and tracking
          is insufficient for messages in cmdline_block mode.
Solution: Add vim.on_key handler while the dialog window is open that
          forwards paging keys to the window.
          Properly render multi-line prompts. Keep track of both the start
          and end of the current cmdline prompt. Append messages after the
          current prompt in cmdline_block mode.
2025-08-21 14:56:59 +02:00
zeertzjq 7d53982b7f vim-patch:84a343a: runtime(doc): correct another problem in :h items()
The returned value is only in arbitrary order for a Dict.

closes: vim/vim#18050

https://github.com/vim/vim/commit/84a343a6ed34995adc67c062b64533c1b0bf7fb1
2025-08-21 08:44:08 +08:00
zeertzjqandChristian Brabandt 1fdacbb3e4 vim-patch:44c8072: runtime(doc): fix style and clarify items() function for String type
related: vim/vim#18021

https://github.com/vim/vim/commit/44c8072ef64a7a218eb8cf4b72866921762633e4

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-08-21 08:44:08 +08:00
zeertzjqandYegappan Lakshmanan 049de6f119 vim-patch:partial:308a313: runtime(doc): Update help for the items() function
closes: vim/vim#18021

https://github.com/vim/vim/commit/308a3130be89148cdaf83bfaf00e3e7c69ed2133

Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
2025-08-21 08:44:07 +08:00
Tiago Inaba 848c7a7894 fix(lsp): update window title when cycling through signatures #35407 2025-08-20 11:09:16 -07:00
bfredl 4a1295c626 Merge pull request #34186 from bfredl/neotags
build: generate helptags without running "nvim" binary
2025-08-20 09:10:02 +02:00
zeertzjqandJon Parise 3d511833ae vim-patch:2f7e4eb: 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: vim/vim#18032

https://github.com/vim/vim/commit/2f7e4eb335df389d73aaeb2ff6879b233c1a293f

Co-authored-by: Jon Parise <jon@indelible.org>
2025-08-20 07:24:35 +08:00
zeertzjqandWuJunkai2004 ba25f3e4d4 vim-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: vim/vim#18027

https://github.com/vim/vim/commit/0c4405a6b2bc4d93c127e1b66da1b93dcfbbe3db

Co-authored-by: WuJunkai2004 <wujunkai20041123@outlook.com>
2025-08-20 07:23:49 +08:00
Sean Dewar 3ec63cdab8 fix(treesitter): run FileType autocmds in the context of <abuf>
Problem: many FileType autocommands assume curbuf is the same as the target
buffer; this can cause &syntax to be restored for the wrong buffer in some cases
when TSHighlighter:destroy is called.

Solution: run nvim_exec_autocmds in the context of the target buffer via
nvim_buf_call.
2025-08-19 20:03:05 +01:00
TheBlob42 701258921e feat(snippet): highlight active tabstop (#35378) 2025-08-19 06:21:32 -07:00
bfredl 6b936002cc build: make build.zig generate helptags without running "nvim" binary
This is matters for cross-compiling where we might not
be able to run the "nvim" binary on the host.

Instead reimplement the helptags extractor as a small
lua script, which we can run on the host using the nlua0
helper already used for other generator scripts.
2025-08-19 11:14:02 +02:00
ite-usagi 1e20f31aa3 docs(tutor): update Japanese tutor #35379 2025-08-18 10:46:56 -07:00
Justin M. Keyes 1b2a6e0664 Merge #35018 refactor(lsp): centralized enable/is_enabled strategy 2025-08-18 10:57:57 -04:00
Yi Ming f40162ba19 refactor(lsp): use vim.lsp._capability.enable internally 2025-08-18 19:41:55 +08:00
Yi Ming 050b04384e refactor(lsp): correct enable marker name 2025-08-18 19:41:55 +08:00
Yi Ming 2ace4089f8 refactor(lsp): no longer rely on LspDetach for detaching capabilities 2025-08-18 19:41:55 +08:00
Yi Ming b3fbc8d6fa refactor(lsp): move util.enable to capability.enable 2025-08-18 19:41:53 +08:00
Justin M. Keyes 960b33a9d8 docs: misc, dev-api-fast, $XDG_STATE_HOME #35138 2025-08-17 20:45:40 -07:00
Siddhant Agarwal 1d40f67776 feat(ssh): SSH configuration parser #35027 2025-08-17 20:40:28 -07:00
Justin M. Keyes d8ed43c6a7 Merge #35109 vim.pos, vim.range 2025-08-17 16:37:56 -04:00
zeertzjqand毛逸宁 35a7642647 vim-patch:3cee950: runtime(diff): fix mixed translations in zh_CN (#35362)
some translations confused zh_CN and zh_TW

https://github.com/vim/vim/commit/3cee950fc9f8cdcfe3f168fe83072b2a9eb15d47

Co-authored-by: 毛逸宁 <mao.yining@outlook.com>
2025-08-17 18:33:29 +08:00
Yi Ming a37e101dc7 refactor(lsp): change capability name to snake case 2025-08-17 12:37:34 +08:00
Yi Ming 7c3e579a90 refactor(lsp): register all derived Capability prototypes 2025-08-17 12:37:34 +08:00
Yi Ming 81d8198bda refactor(lsp): define Capability.on_attach 2025-08-17 12:37:34 +08:00
Yi Ming a7fef170b7 refactor(lsp): check supported methods instead of tbl_get 2025-08-17 12:37:34 +08:00
Yi Ming 9f5b309d82 feat(lua): conversion between vim and lsp position/range 2025-08-17 12:13:24 +08:00
Yi Ming 98f8224c19 feat(lua): vim.pos/vim.range 2025-08-17 11:54:53 +08:00
zeertzjqandChristian Brabandt 7e450aa383 vim-patch:b405c79: runtime(vim): set 'comments' based on script type (legacy/Vim9) (#35359)
fixes: vim/vim#18000

https://github.com/vim/vim/commit/b405c790046fc6758bf4a90feb6a67c2411685a0

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-08-17 01:26:37 +00:00
zeertzjqandDavid Friant 577f9fa1be vim-patch:9.1.1640: Unicode has deprecated some code-points (#35358)
Problem:  Unicode has deprecated some code-points
Solution: Update the digraph tables to align with the Unicode v16
          release (David Friant)

This commit updates the digraphs Left-Pointing Angle Bracket '</'
and Right-Pointing Angle Bracket '/>' to account for the fact that
the old Unicode codepoints for them (2329 and 232A, respectively)
have been deprecated. As per the Miscellaneous Technical code chart
(https://www.unicode.org/charts/PDF/U2300.pdf), the old digraphs
have been reassigned to the CJK Left Angle Bracket and Right Angle
Bracket (3008 and 3009) with their declaration moved to the
appropriate block.

This commit also introduces the new digraphs '<[' and ']>' to
represent the Mathematical Left Angle Bracket and Mathematical
Right Angle Bracket (27E8 and 27E9) to replace the deprecated code
points in the Technical block.

Tests have been added and, I believe, the documentation has been
updated accordingly.

closes: vim/vim#17990

https://github.com/vim/vim/commit/c08b94b072588d69e0fe76bc93dcd1d8c46be469

Co-authored-by: David Friant <friant@HPEnvyx360.friant.dev>
2025-08-17 08:52:05 +08:00
Michael Henry 5f8d4a248a feat(provider): detect venv python via "pynvim-python" tool #35273
Problem:
Detection of the pynvim module is currently done by finding the first
Python interpreter in the `PATH` and checking if it can import pynvim.
This has several problems:
- Activation of an unrelated Python virtual environment will break
  automatic detection, unless pynvim is also installed in that
  environment.
- Installing pynvim to the expected location is difficult. User
  installation into the system-wide or user-wide Python site area is now
  deprecated.  On Ubuntu 24.04 with Python 3.12, for example, the
  command `pip install --user pynvim` now fails with the error message
  `error: externally-managed-environment`.
- Users may create a dedicated virtual environment in which to install
  pynvim, but Nvim won't detect it; instead, they must either activate
  it before launching Nvim (which interferes with the user of other
  virtual environments) or else hard-code the variable
  `g:python3_host_prog` in their `init.vim` to the path of the correct
  Python interpreter.  Neither option is desirable.

Solution:
Expose pynvim's Python interpreter on the `PATH` under the
name `pynvim-python`.  Typical user-flow:

1. User installs either uv or pipx.
2. User installs pynvim via:
   ```
   uv tool install --upgrade pynvim
   # Or:
   pipx install --upgrade pynvim
   ```

With corresponding changes in pynvim https://github.com/neovim/pynvim/issues/593
the above user-flow is all that's needed for Nvim to detect the
installed location of pynvim, even if an unrelated Python virtual
environments is activated.  It uses standard Python tooling to automate
the necessary creation of a Python virtual environment for pyenv and the
publication of `pynvim-python` to a directory on `PATH`.
2025-08-16 14:48:08 -07:00
zeertzjqandYee Cheng Chin 013af17ed9 vim-patch:9.1.1623: Buffer menu does not handle unicode names correctly (#35353)
Problem:  Buffer menu does not handle unicode names correctly
          (after v9.1.1622)
Solution: Fix the BMHash() function (Yee Cheng Chin)

The Buffers menu uses a BMHash() function to generate a sortable number
to be used for the menu index. It used a naive (and incorrect) way of
encoding multiple ASCII values into a single integer, but assumes each
character to be only in the ASCII 32-96 range. This means if we use
non-ASCII file names (e.g. Unicode values like CJK or emojis) we get
integer underflow and overflow, causing the menu index to wrap around.
Vim's GUI implementations internally use a signed 32-bit integer for the
`gui_mch_add_menu_item()` function and so we need to make sure the menu
index is in the (0, 2^31-1) range.

To do this, if the file name starts with a non-ASCII value, we just use
the first character's value and set the high bit so it sorts after the
other ASCII ones. Otherwise, we just take the first 5 characters, and
use 5 bit for each character to encode a 30-bit number that can be
sorted.

This means Unicode file names won't be sorted beyond the first
character. This is likely going to be fine as there are lots of ways to
query buffers.

related: vim/vim#17403
closes: vim/vim#17928

https://github.com/vim/vim/commit/8f9de4991e84dfdc9bcc9dad0eaa2b3544ef963e

Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
2025-08-16 13:20:36 +08:00
Siddhant Agarwal 649bb372f6 feat(ui): :connect command #34586
Add the `:connect <address>` command which connects the currently
running TUI to the server at the given address.
2025-08-14 15:58:09 -07:00
Jalil David Salamé Messina bd45e2be63 fix(checkhealth): wrong ABI version for treesitter parsers #35327
Don't print ABI version of duplicated parsers that are later in the
runtime path (see [#35326]).

Change the sorting from `name > path` to `name > rtpath_index`, this
ensures the first (loaded) parser is first in the list and any
subsequent parsers can be considered "not loaded".

This is fuzzy at best since `vim.treesitter.language.add` can take a
path to a parser and change the load order.

The correct solution is for `vim.treesitter.language.inspect` to return
the parser path so we can compare against it and/or for it to also be
able to take a path to a parser so we can inspect it without loading it
first.
2025-08-14 11:47:43 -07:00
bfredl 442f297c63 refactor(build): remove INCLUDE_GENERATED_DECLARATIONS guards
These are not needed after #35129 but making uncrustify still play nice
with them was a bit tricky.

Unfortunately `uncrustify --update-config-with-doc` breaks strings
with backslashes. This issue has been reported upstream,
and in the meanwhile auto-update on every single run has been disabled.
2025-08-14 09:34:38 +02:00
zeertzjqandJon Parise d19d2b4491 vim-patch:1ee1d9b: runtime(python): highlight "self" and "cls" in syntax 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-14 08:36:24 +08:00
zeertzjqandGirish Palya 6f0ef8a5f2 vim-patch:c93a2b3: runtime(doc): Adapt fuzzy doc to reflect 'fzy' algorithm
closes: vim/vim#17988

https://github.com/vim/vim/commit/c93a2b332734086ef94c4abf407f584e1e41bd55

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-14 06:48:31 +08:00
zeertzjqandGirish Palya 869000e7ce vim-patch:9.1.1627: fuzzy matching can be improved
Problem:  fuzzy-matching can be improved
Solution: Implement a better fuzzy matching algorithm
          (Girish Palya)

Replace fuzzy matching algorithm with improved fzy-based implementation

The
[current](https://www.forrestthewoods.com/blog/reverse_engineering_sublime_texts_fuzzy_match/)
fuzzy matching algorithm has several accuracy issues:

* It struggles with CamelCase
* It fails to prioritize matches at the beginning of strings, often
  ranking middle matches higher.

After evaluating alternatives (see my comments
[here](https://github.com/vim/vim/issues/17531#issuecomment-3112046897)
and
[here](https://github.com/vim/vim/issues/17531#issuecomment-3121593900)),
I chose to adopt the [fzy](https://github.com/jhawthorn/fzy) algorithm,
which:

* Resolves the aforementioned issues.
* Performs better.

Implementation details

This version is based on the original fzy
[algorithm](https://github.com/jhawthorn/fzy/blob/master/src/match.c),
with one key enhancement: **multibyte character support**.

* The original implementation supports only ASCII.
* This patch replaces ascii lookup tables with function calls, making it
  compatible with multibyte character sets.
* Core logic (`match_row()` and `match_positions()`) remains faithful to
  the original, but now operates on codepoints rather than single-byte
  characters.

Performance

Tested against a dataset of **90,000 Linux kernel filenames**. Results
(in milliseconds) show a **\~2x performance improvement** over the
current fuzzy matching algorithm.

```
Search String            Current Algo    FZY Algo
-------------------------------------------------
init                          131.759    66.916
main                          83.688     40.861
sig                           98.348     39.699
index                         109.222    30.738
ab                            72.222     44.357
cd                            83.036     54.739
a                             58.94      62.242
b                             43.612     43.442
c                             64.39      67.442
k                             40.585     36.371
z                             34.708     22.781
w                             38.033     30.109
cpa                           82.596     38.116
arz                           84.251     23.964
zzzz                          35.823     22.75
dimag                         110.686    29.646
xa                            43.188     29.199
nha                           73.953     31.001
nedax                         94.775     29.568
dbue                          79.846     25.902
fp                            46.826     31.641
tr                            90.951     55.883
kw                            38.875     23.194
rp                            101.575    55.775
kkkkkkkkkkkkkkkkkkkkkkkkkkkkk 48.519     30.921
```

```vim
vim9script

var haystack = readfile('/Users/gp/linux.files')

var needles = ['init', 'main', 'sig', 'index', 'ab', 'cd', 'a', 'b',
'c', 'k',
    'z', 'w', 'cpa', 'arz', 'zzzz', 'dimag', 'xa', 'nha', 'nedax',
'dbue',
    'fp', 'tr', 'kw', 'rp', 'kkkkkkkkkkkkkkkkkkkkkkkkkkkkk']
for needle in needles
    var start = reltime()
    var tmp = matchfuzzy(haystack, needle)
    echom $'{needle}' (start->reltime()->reltimefloat() * 1000)
endfor
```

Additional changes

* Removed the "camelcase" option from both matchfuzzy() and
  matchfuzzypos(), as it's now obsolete with the improved algorithm.

related: neovim/neovim#34101
fixes vim/vim#17531
closes: vim/vim#17900

https://github.com/vim/vim/commit/7e0df5eee9eab872261fd5eb0068cec967a2ba77

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-08-14 06:48:30 +08:00