Problems:
- Miss some entries in `vim_diff.txt` and `index.txt`.
- I want to learn about Vim register, but when I type `:h register`, it
shows sponsor information instead. Note that unlike Nvim, Vim has a
separate session for `*register*`
Solution:
- Add missing commands to `index.txt`, `vim_diff.txt`
- Remove tag `register` from `index.txt`
Problem: filetype: autopkgtest files are not recognized
Solution: detect */debian/tests/control files as autopkgtest filetype
(James McCoy)
Autopkgtest is a Debian tool for testing installed versions of packages
when other, related packages are updated.
Reference:
- https://www.debian.org/doc/debian-policy/autopkgtest.txt
related: vim/vim#176795bcc492649
Co-authored-by: James McCoy <jamessan@jamessan.com>
Problem:
Closes#31453
Solution:
Introduce `vim.lsp.Capability`, which may serve as the base class for
all LSP features that require caching data. it
- was created if there is at least one client that supports the specific method;
- was destroyed if all clients that support the method were detached.
- Apply the refactor for `folding_range.lua` and `semantic_tokens.lua`.
- Show active features in :checkhealth.
Future:
I found that these features that are expected to be refactored by
`vim.lsp.Capability` have one characteristic in common: they all send
LSP requests once the document is modified. The following code is
different, but they are all for this purpose.
- semantic tokens:
fb8dba413f/runtime/lua/vim/lsp/semantic_tokens.lua (L192-L198)
- inlay hints, folding ranges, document color
fb8dba413f/runtime/lua/vim/lsp/inlay_hint.lua (L250-L266)
I think I can sum up this characteristic as the need to keep certain
data synchronized with the latest version computed by the server.
I believe we can handle this at the `vim.lsp.Capability` level, and
I think it will be very useful.
Therefore, my next step is to implement LSP request sending and data
synchronization on `vim.lsp.Capability`, rather than limiting it to the
current create/destroy data approach.
Problem: getcompletiontype() crashes when no completion is available
(after v9.1.1509).
Solution: Don't call set_expand_context() (zeertzjq)
fixes: vim/vim#17681closes: vim/vim#17684e2c0f81dd0
Problem:
Error when adding a plugin will make all following plugins not
`:packadd`ed
Solution:
- add() should handle errors from :packadd with pcall()
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com>
Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
Problem: Patch 9.1.1505 was not good
Solution: Revert "patch 9.1.1505: not possible to return completion type
for :ex command" and instead add the getcompletiontype()
function (Hirohito Higashi).
related: vim/vim#17606closes: vim/vim#1766296b3ef2389
Cherry-pick Test_multibyte_expression() from Vim, as it passes.
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
Problem: not possible to return command-line completion type for :ex
command
Solution: make getcmdcompltype() accept an optional and return the
command-line completion for that arg (Shougo Matsushita).
closes: vim/vim#176065d2354fc07
Co-authored-by: Shougo Matsushita <Shougo.Matsu@gmail.com>
- Match escape sequences in :command replacement blocks.
- Match :substitute after escape sequences (a temporary fix until Ex
commands are contained).
fixes: vim/vim#17326closes: vim/vim#17663a8b86605f3
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
- Match Conceal, ComplMatchIns, MsgArea, Terminal, and User[1-9]
highlight groups.
- Generate the vimGroup syntax group from runtime/syncolor.vim.
- Match :SynColor and :SynLink as special user commands.
fixesvim/vim#17467closes: vim/vim#17556c233c2e6a5
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem: completion: can only complete from keyword characters
Solution: remove this restriction, allow completion functions when
called from i_CTRL-N/i_CTRL-P to be triggered from non-keyword
characters (Girish Palya)
Previously, functions specified in the `'complete'` option were
restricted to starting completion only from keyword characters (as
introduced in PR 17065). This change removes that restriction.
With this change, user-defined functions (e.g., `omnifunc`, `userfunc`)
used in `'complete'` can now initiate completion even when triggered
from non-keyword characters. This makes it easier to reuse existing
functions alongside other sources without having to consider whether the
cursor is on a keyword or non-keyword character, or worry about where
the replacement should begin (i.e., the `findstart=1` return value).
The logic for both the “collection” and “filtering” phases now fully
respects each source’s specified start column. This also extends to
fuzzy matching, making completions more predictable.
Internally, this builds on previously merged infrastructure that tracks
per-source metadata. This PR focuses on applying that metadata to
compute the leader string and insertion text appropriately for each
match.
Also, a memory corruption has been fixed in prepare_cpt_compl_funcs().
closes: vim/vim#17651ba11e78f1d
Co-authored-by: Girish Palya <girishji@gmail.com>
last `unmap` can cause the error "E31: No such mapping" when
`doaudocmd FileType go` if appending other commands to `b:undo_ftplugin` i.e.
the space and the next bar as `let b:undo_ftplugin .= ' | setl ...'`.
closes: vim/vim#17664f9d87fa6ba
Co-authored-by: ichizok <gclient.gaap@gmail.com>
Problem: 'wildchar' does not work in search contexts
Solution: implement search completion when 'wildchar' is typed
(Girish Palya).
This change enhances Vim's command-line completion by extending
'wildmode' behavior to search pattern contexts, including:
- '/' and '?' search commands
- ':s', ':g', ':v', and ':vim' commands
Completions preserve the exact regex pattern typed by the user,
appending the completed word directly to the original input. This
ensures that all regex elements — such as '<', '^', grouping brackets
'()', wildcards '\*', '.', and other special characters — remain intact
and in their original positions.
---
**Use Case**
While searching (using `/` or `?`) for lines containing a pattern like
`"foobar"`, you can now type a partial pattern (e.g., `/f`) followed by
a trigger key (`wildchar`) to open a **popup completion menu** showing
all matching words.
This offers two key benefits:
1. **Precision**: Select the exact word you're looking for without
typing it fully.
2. **Memory aid**: When you can’t recall a full function or variable
name, typing a few letters helps you visually identify and complete the
correct symbol.
---
**What’s New**
Completion is now supported in the following contexts:
- `/` and `?` search commands
- `:s`, `:g`, `:v`, and `:vimgrep` ex-commands
---
**Design Notes**
- While `'wildchar'` (usually `<Tab>`) triggers completion, you'll have
to use `<CTRL-V><Tab>` or "\t" to search for a literal tab.
- **Responsiveness**: Search remains responsive because it checks for
user input frequently.
---
**Try It Out**
Basic setup using the default `<Tab>` as the completion trigger:
```vim
set wim=noselect,full wop=pum wmnu
```
Now type:
```
/foo<Tab>
```
This opens a completion popup for matches containing "foo".
For matches beginning with "foo" type `/\<foo<Tab>`.
---
**Optional: Autocompletion**
For automatic popup menu completion as you type in search or `:`
commands, include this in your `.vimrc`:
```vim
vim9script
set wim=noselect:lastused,full wop=pum wcm=<C-@> wmnu
autocmd CmdlineChanged [:/?] CmdComplete()
def CmdComplete()
var [cmdline, curpos, cmdmode] = [getcmdline(), getcmdpos(),
expand('<afile>') == ':']
var trigger_char = '\%(\w\|[*/:.-]\)$'
var not_trigger_char = '^\%(\d\|,\|+\|-\)\+$' # Exclude numeric range
if getchar(1, {number: true}) == 0 # Typehead is empty, no more
pasted input
&& !wildmenumode() && curpos == cmdline->len() + 1
&& (!cmdmode || (cmdline =~ trigger_char && cmdline !~
not_trigger_char))
SkipCmdlineChanged()
feedkeys("\<C-@>", "t")
timer_start(0, (_) => getcmdline()->substitute('\%x00', '',
'ge')->setcmdline()) # Remove <C-@>
endif
enddef
def SkipCmdlineChanged(key = ''): string
set ei+=CmdlineChanged
timer_start(0, (_) => execute('set ei-=CmdlineChanged'))
return key == '' ? '' : ((wildmenumode() ? "\<C-E>" : '') .. key)
enddef
**Optional: Preserve history recall behavior**
cnoremap <expr> <Up> SkipCmdlineChanged("\<Up>")
cnoremap <expr> <Down> SkipCmdlineChanged("\<Down>")
**Optional: Customize popup height**
autocmd CmdlineEnter : set bo+=error | exec $'set ph={max([10,
winheight(0) - 4])}'
autocmd CmdlineEnter [/?] set bo+=error | set ph=8
autocmd CmdlineLeave [:/?] set bo-=error ph&
```
closes: vim/vim#175706b49fba8c8
Co-authored-by: Girish Palya <girishji@gmail.com>
The examples mention the [u] flag, so at least the [u] flag should be
introduced before the examples.
Slightly reword the sentence about trailing/leading white space.
closes: vim/vim#176041c471ac548
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Problem: no easy way to deduplicate text
Solution: add the :uniq ex command
(Hirohito Higashi)
closes: vim/vim#1753874f0a77bb9
Co-authored-by: Hirohito Higashi <h.east.727@gmail.com>
Problem: File paths change from symlink to target path after :cd command
when editing files through symbolic links
Solution: Add "~" flag to 'cpoptions' to control symlink resolution.
When not included (default), symlinks are resolved maintaining
backward compatibility. When included, symlinks are preserved
providing the improved behavior. (glepnir)
related: neovim/neovim#15695closes: vim/vim#176284ade668fb6
Make `vim.iter():take()` and `vim.iter():skip()`
optionally accept predicates to enable takewhile
and skipwhile patterns used in functional
programming.
Problem:
The previous fix in #34314 relies on copying the tree in `tree_root` to
ensure the `TSNode`'s tree cannot be mutated. But that causes the
problem where two calls to `tree_root` return nodes from different
copies of a tree, which do not compare as equal. This has broken at
least one plugin.
Solution:
Make all `TSTree`s on the Lua side always immutable, avoiding the need
to copy the tree in `tree_root`, and make the only mutation point,
`tree_edit`, copy the tree instead.
731e616a79 made it so passing `{env = nil, clear_env = true }` would
pass `{env = {}}` to `vim.uv.spawn`.
However this is not what `clear_env` is (arguably) supposed to do.
If `env=nil` then that implies the uses wants `vim.uv.spawn()` to use
the default environment. Adding `clear_env = true` simply prevents
`NVIM` (the base environment) from being added.
Fixes#34730