Commit Graph

9419 Commits

Author SHA1 Message Date
Justin M. Keyes
1cb1cfead0 docs: drop "xx.vim" syntax help-tags #35623
Problem:
These "foo.vim" syntax tags add 100+ useless tags to help. In
particular, "progress.vim" is the first match for "progress", which not
the result anyone is actually looking for, since Nvim 0.12 gained the
"progress-message" feature.

Solution:
Drop the "foo.vim" syntax tags. The "ft-foo" tags are more appropriately
named.
2025-09-07 20:45:22 -07:00
zeertzjq
29f30ad91c vim-patch:9.1.1679: unclear what key causes CmdlineLeave autocommand (#35677)
Problem:  unclear what key causes CmdlineLeave autocommand
Solution: Set |v:char| to the key (Girish Palya).

related: vim/vim#17806
closes: vim/vim#18063

ba9551d131

Co-authored-by: Girish Palya <girishji@gmail.com>
2025-09-08 11:40:12 +08:00
Evgeni Chasnovski
0c49167490 docs: adjust *lua-plugin-init* wording #35600
Problem: Unnecessarily anecdotal wording.

Solution: Adjust wording while delivering the same message.
2025-09-07 15:04:09 -07:00
Evgeni Chasnovski
fa3920282d fix(pack): handle Git environment variables #35626
Problem: Some environment variables which are useful when working inside
  a bare repository can affect any Git operation.

Solution: Explicitly unset problematic environment variables.
2025-09-07 14:42:09 -07:00
skewb1k
448f15ca39 feat(json): pretty-format (indent) with vim.json.encode() #35424
Problem:
There is no straightforward way to pretty-print objects as JSON.
The existing `vim.inspect` outputs LON.

Solution:
Introduce an `indent` option for `vim.json.encode()` which enables
human-readable output with configurable indentation.

Adapts PR to upstream: openresty/lua-cjson#114
2025-09-07 14:38:27 -07:00
Evgeni Chasnovski
7853cde29a feat(pack): vim.pack.get() gets VCS info #35631
Problem:
Force resolve `spec.version` overrides the information about whether
a user supplied `version` or not. Knowing it might be useful in some use
cases (like comparing to previously set `spec` to detect if it has
changed).

Solution:
Do not resolve `spec.version`. This also improves speed when triggering
events and calling `get()`.
- Place default branch first when listing all branches.
- Use correct terminology in `get_hash` helper.
- Do not return `{ '' }` if there are no tags.

Problem:
There is no way to get more information about installed plugins, like
current revision or default branch (necessary if resolving default
`spec.version` manually). As computing Git data migth take some time,
also allow `get()` to limit output to only necessary set of plugins.

Solution:
- introduce arguments to `get(names, opts)`, which follows other
  `vim.pack` functions. Plugin extra info is returned by default and
  should be opt-out via `opts.info = false`.
  - Examples:
    - Get current revision: `get({ 'plug-name' })[1].rev`
    - Get default branch: `get({ 'plug_name' })[1].branches[1]`
- `update()` and `del()` act on plugins in the same order their names
  are supplied. This is less surprising.
- default `opts.info` to `true` since this simplifies logic for the
  common user, while still leaving the door open for a faster `get()` if
  needed.
2025-09-07 09:59:31 -07:00
zeertzjq
4521f6da7d vim-patch:1ed2ff7: runtime(m4): Remove m4Type and leftover m4Function in syntax script
closes: vim/vim#18223

1ed2ff77d8

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-09-07 21:22:52 +08:00
zeertzjq
91fa613fad vim-patch:6505dc6: 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: vim/vim#18208

6505dc69d3

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-09-07 21:22:12 +08:00
zeertzjq
30dc9934a6 vim-patch:efb913a: runtime(m4): Remove m4Function
closes: vim/vim#18211

efb913a4f5

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-09-07 21:21:33 +08:00
Maria José Solano
21f2c2b19c docs(lsp): tweak inline_completion.get code snippet #35657
`replace_keycodes` is true if `expr` is set, and "Accept" is a better
term to describe the keymap.
2025-09-06 16:12:32 -07:00
Lewis Russell
ef48104c31 fix(types): nvim_get_win_config return type #35639 2025-09-06 14:19:12 -07:00
Phạm Bình An
798bb3f66a docs: details dict in nvim_buf_get_extmark() #35289
Problem: The document of nvim_buf_get_extmark currently lacks the
following:
- "details" directory: nvim_buf_get_extmarks() allows an option details
  to get a "details" directory in result, but it doesn't mention where
  that "details" directory is, what fields does it have.

Solution: Add docs for "details" directory in nvim_buf_get_extmarks()
2025-09-06 13:38:31 -07:00
zeertzjq
63b53c8d15 vim-patch:dfcd9ac: runtime(ada): mark as unmaintained, fix a few issues with the ftplugin
closes: vim/vim#18178

dfcd9ac120

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-09-06 08:16:23 +08:00
zeertzjq
26c9f31b91 vim-patch:f737ff8: runtime(hamster): do not globally set ignorecase
related: vim/vim#15772

f737ff8c88

Co-authored-by: Christian Brabandt <cb@256bit.org>
2025-09-06 08:15:58 +08:00
zeertzjq
54208da5c4 vim-patch:510ca80: runtime(m4): Improve comments, distinguish them from #-lines
closes: vim/vim#18200

510ca80c58

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-09-06 08:15:37 +08:00
zeertzjq
b399a13f70 vim-patch:f1212a7: runtime(python): Do not match contained identifiers as pythonType
related: vim/vim#17962
closes: vim/vim#18206

f1212a7b45

Co-authored-by: Rob B <github@0x7e.net>
2025-09-06 07:08:23 +08:00
zeertzjq
665d5d80ac vim-patch:d2b28dd: runtime(python): add syntax support inside f-strings
fixes: vim/vim#14033
closes: vim/vim#17962

d2b28ddfc2

Co-authored-by: Rob B <github@0x7e.net>
2025-09-06 07:07:34 +08:00
Evgeni Chasnovski
069be91106 feat(pack): use nvim_echo{kind=progress} to report progress #35625
Problem: Progress reports use plain `nvim_echo()` with manually
  constructed messages and populate history on every call.

Solution: Use `nvim_echo()` with newly added `kind=progress` which (at
  least for now) is meant to be a unified interface for showing progress
  report. Also save in history only first and last progress report
  messages.
2025-09-05 07:12:28 -07:00
zeertzjq
0bafbe872b vim-patch:9.1.1732: filetype: .inc file detection can be improved (#35635)
Problem:  filetype: .inc file detection can be improved
Solution: Update filetype detection for Pascal and BitBake code
          (Martin Schwan).

Fix the detection of .inc files containing Pascal and BitBake code:

- the concatenated string, merged from three lines, only contains one
  beginning and the pattern "^" would not match as expected. Use a range()
  loop to iterate each line string individually. This way, the pattern "^"
  works for beginning of lines.

- improve BitBake include file detection by also matching forward-slashes
  "/" in variable names and assignment operators with a dot ".=" and "=.".
  Valid examples, which should match, are:

    PREFERRED_PROVIDER_virtual/kernel = "linux-yocto"
    MACHINEOVERRIDES =. "qemuall:"
    BBPATH .= ":${LAYERDIR}"

- parse twenty instead of just three lines, to accommodate for potential
  comments at the beginning of files

closes: vim/vim#18202

9fd1a657d2

Co-authored-by: Martin Schwan <m.schwan@phytec.de>
2025-09-05 17:22:24 +08:00
Justin M. Keyes
2affb8373f docs: api events 2025-09-04 00:11:52 -04:00
Justin M. Keyes
9c3099f0cf docs: lsp, misc
- Problem: It's not clear for new plugin developers that `:help` uses
  a help-tags file for searching the docs, generated by `:helptags`.
  - Solution: Hint to the |:helptags| docs for regenerating the tags
    file for their freshly written documentation.

Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
2025-09-03 23:03:51 -04:00
zeertzjq
17da1ad8f4 vim-patch:9.1.1730: filetype: vivado journal/log files are not recognized (#35613)
Problem:  filetype: vivado journal/log files are not recognized
Solution: Detect vivado*.{jou,log} as tcl filetype (Wu Zhenyu).

closes: vim/vim#18191

9a6cafdc1c

Also fix missing anchor in the pattern from the port of patch 9.1.1602.

Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
2025-09-04 07:16:47 +08:00
zeertzjq
967d226f96 vim-patch:f165798: 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: vim/vim#18192

f165798184

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-09-03 21:28:11 +08:00
zeertzjq
c4c9daf7e2 vim-patch:e0704a3: runtime(keymap): Add transliteration (buckwalter) arabic keymap
References:
- https://en.wikipedia.org/wiki/Buckwalter_transliteration
- http://qamus.org/transliteration.htm

closes: vim/vim#18186

e0704a3593

Co-authored-by: Rafael Ketsetsides <rketsetsides@gmail.com>
2025-09-03 21:27:24 +08:00
zeertzjq
1ae09bf545 vim-patch:4c39d0c: runtime(doc): quote partial urls with a backtick (#35606)
closes: vim/vim#18194

4c39d0cc9b

Co-authored-by: Yochem van Rosmalen <git@yochem.nl>
2025-09-03 09:07:01 +08:00
Shadman
79bfeecdb4 feat(editor)!: insert-mode ctrl-r should work like paste #35477
Problem:
insert-mode ctrl-r input is treated like raw user input, which is almost
never useful. This means any newlines in the input are affected by
autoindent, etc., which is:
- slow
- usually breaks the formatting of the input

Solution:
- ctrl-r should be treated like a paste, not user-input.
- does not affect `<c-r>=`, so `<c-r>=@x` can still be used to get the
  old behavior.

Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2025-09-01 21:05:16 -07:00
zeertzjq
b4d21f141c vim-patch:71149df: runtime(java): Dismiss "g:markdown_fenced_languages" for Java buffers (#35596)
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: vim/vim#17308
related: vim/vim#17220
closes: vim/vim#18172

71149dfec5

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
2025-09-02 08:28:07 +08:00
Justin M. Keyes
a5e7ccc329 docs: Lua plugin development guide 2025-09-01 19:42:45 -04:00
Marc Jakobi
28ab656122 docs: Lua plugin development guide 2025-09-01 18:42:02 -04:00
Shadman
8a12a01466 feat(progress): better default format + history sync #35533
Problem:
The default progress message doesn't account for
message-status. Also, the title and percent sections don't get written
to history. And progress percent is hard to find with variable length messages.

Solution:
Apply highlighting on Title based on status. And sync the formated msg
in history too. Also updates the default progress message format to
{title}: {percent}% msg
2025-09-01 15:13:21 -07:00
Yochem van Rosmalen
4cda52a5d1 docs(treesitter): fix language-injection url #35592 2025-09-01 14:08:08 -07:00
Justin M. Keyes
d8a8825679 feat(lua): vim.wait() returns callback results #35588
Problem:
The callback passed to `vim.wait` cannot return results directly, it
must set upvalues or globals.

    local rv1, rv2, rv3
    local ok = vim.wait(200, function()
      rv1, rv2, rv3 = 'a', 42, { ok = { 'yes' } }
      return true
    end)

Solution:
Let the callback return values after the first "status" result.

    local ok, rv1, rv2, rv3 = vim.wait(200, function()
      return true, 'a', 42, { ok = { 'yes' } }
    end)
2025-09-01 13:26:46 -07:00
Yi Ming
6888f65be1 feat(lsp): vim.lsp.inline_completion on_accept #35507 2025-09-01 08:46:29 -07:00
Volodymyr Chernetskyi
06df337617 vim-patch:9.1.1718: filetype: kubectl config file is not recognized #35583
Problem:  filetype: kubectl config file is not recognized
Solution: Detect .kube/kubectl as yaml filetype
          (Volodymyr Chernetskyi).

References:
- https://kubernetes.io/docs/reference/kubectl/kuberc/

closes: vim/vim#18169

6cd6857cbe
2025-09-01 08:16:43 -07:00
Volodymyr Chernetskyi
8fc1db043a vim-patch:9.1.1717: filetype: AWS cli alias file is not recognized #35581
Problem:  filetype: AWS cli alias file is not recognized
Solution: Detect .aws/cli/alias as confini filetype
          (Volodymyr Chernetskyi).

References:
- https://docs.aws.amazon.com/cli/v1/userguide/cli-usage-alias.html

related: vim/vim#18169

be0589f1d2
2025-09-01 08:16:34 -07:00
Riley Bruins
77e3efecee feat(lsp): support textDocument/onTypeFormatting (#34637)
Implements [on-type
formatting](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_onTypeFormatting)
using a `vim.on_key()` approach to listen to typed keys. It will listen
to keys on the *left hand side* of mappings. The `on_key` callback is
cleared when detaching the last on-type formatting client. This feature
is disabled by default.

Co-authored-by: Maria José Solano <majosolano99@gmail.com>
2025-08-31 14:09:12 -07:00
Michael Henry
f311c96973 fix(health): update advice for Python #35564
Problem: `:checkhealth` advice for Python is out-of-date.

Solution: Update the advice to point to `:help provider-python`.
2025-08-31 11:17:21 -07:00
glepnir
1b3abfa688 docs(lsp): mention lsp/after/ in faq #35534 2025-08-30 10:31:16 -07:00
Volodymyr Chernetskyi
c333d64663 vim-patch:9.1.1709: filetype: kyaml files are not recognized
Problem:  filetype: kyaml files are not recognized
Solution: Detect *.kyml files as yaml filetype
          (Volodymyr Chernetskyi)

References:
- https://kubernetes.io/blog/2025/08/27/kubernetes-v1-34-release/#alpha-support-for-kyaml-a-kubernetes-dialect-of-yaml

closes: vim/vim#18158

d5c89cc6bb

Co-authored-by: Volodymyr Chernetskyi <19735328+chernetskyi@users.noreply.github.com>
2025-08-30 11:58:00 +02:00
zeertzjq
6eebf30a39 vim-patch:7239d95: runtime(vim): Update base syntax, match :defer command argument (#35547)
closes: vim/vim#18159

7239d95bf2

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
2025-08-30 08:15:01 +08:00
zeertzjq
8a2587be23 Merge pull request #35546 from zeertzjq/vim-a07a2f4
vim-patch:a07a2f4: runtime(astro): catch json_decode() error when parsing tsconfig.json
2025-08-30 08:14:15 +08:00
zeertzjq
68a2e0ef78 vim-patch:9.1.1713: filetype: fvwm2m4 files are no longer detected
Problem:  filetype: fvwm2m4 files are no longer recognized
          (after 9.1.1687).
Solution: Add a special case in m4 filetype detection (zeertzjq).

closes: vim/vim#18146

5355e81868

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-08-30 06:57:09 +08:00
zeertzjq
dab31a3637 vim-patch:9.1.1687: filetype: autoconf filetype not always correct
Problem:  filetype: autoconf filetype not always correct
Solution: Detect aclocal.m4 as config filetype, detect configure.ac as
          config filetype, fall back to POSIX m4 (Damien Lejay).

closes: vim/vim#18065

2b55474f0a

Co-authored-by: Damien Lejay <damien@lejay.be>
2025-08-30 06:57:08 +08:00
bfredl
772f1966a3 Merge pull request #31400 from vanaigr/decor-provider-range
feat(decor): add range-based highlighting
2025-08-29 10:33:15 +02:00
zeertzjq
19f2e5c3eb vim-patch:b760062: runtime(debversions): Move bullseye, focal, and oracular to "unsupported" (#35531)
These versions have exited their standard support term as of
- bullseye: 2024-08-14
- focal: 2025-05
- oracular: 2025-07-10

closes: vim/vim#18134

b760062897

Co-authored-by: James McCoy <jamessan@jamessan.com>
2025-08-29 07:23:43 +08:00
Siddhant Agarwal
7a71235399 fix(server): serverlist({peer=true}) does not find peer servers #35506 2025-08-28 06:41:31 -07:00
Shadman
bc6737250d fix(progress): simplify ui-event, introduce default presentation #35527
Problem:
`msg_show` has "progress" info (title, status, percent) which is not presented
by default.

Solution:
Format TUI messages as `{title}: {msg}...{percent}%`. This also gets sent to UI.

- With specific formatting sent to UI we can remove the `progress` item from
  `msg_show` event. It can be added if needed in the future. Also, having
  a default presentation makes the feature more useful.
- For `vim._extui` we just need to implement the replace-msg-with-same-id
  behavior.
- If any UI/plugin wants to do anything fancier, they can handle the `Progress`
  event.
2025-08-28 06:33:41 -07:00
vanaigr
5edbabdbec perf: add on_range in treesitter highlighting 2025-08-28 08:22:38 -05:00
Christian Clason
c10e36fc01 refactor(lua): consistent use of local aliases 2025-08-28 11:34:01 +02:00
Meriel Luna Mittelbach
a33284c2c0 fix(health): accept TERM=tmux-direct #35511
tmux-direct is functionally the same as tmux-256color, except it
directly reports 24-bit color and how to set them (setaf/setab)
via ncurses 6.x's extended terminfo format.
2025-08-27 20:01:07 -07:00