On linux /dev/stdin is defined as a symlink to /proc/self/fd/0
This in turn is defined as a "magic" symlink which is allowed to point
to internal kernel objects which really does not have a file
name. As a glaring inconsistency, fopen("/proc/self/fd/0", "r")
works if fd was originally opened using pipe() but not using
socketpair(). As it happens UV_CREATE_PIPE does not create pipes
but creates socket pairs. These two unfortunate conditions
means that using /dev/stdin and similar does not work in
shell commands in nvim on linux. as a work around, override
libuv's descicion and create an actual pipe pair.
This change is not needed on BSD:s but done unconditionally for simplicity,
except for on windows where it is not done for stdout because of windows
fixes#35984
vim-patch:536ee91: runtime(doc): add termdebug tag, remove term "floating window"
Problem:
- When I type `:h termdebug`, I will expect to see the introduction of
the termdebug plugin. But instead, it shows me document of
`termdebug_wide`, and I have to scroll up quite much to find the
introduction.
- `:h popup` says `floating-window`? Why? As I have tried both features
(of Vim and Neovim), I think they are _very different_ things, even
more different than job features in Vim and Neovim.
Solution:
- In `:h terminal.txt`, add tag `*termdebug*` to the introduction of
termdebug plugin.
- In `:h popup.txt`, "floating window" -> "popup window".
closes: vim/vim#19135536ee91189
Change the title ":Termdebug plugin" to simply ":Termdebug", otherwise
the line is too long.
Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
Problem:
ICCF Holland is dissolved by the end of 2025 ^1 and sponsorships are
transferred to Kuwasha (https://kuwasha.net). Their SSL certificate is
already expired, so the https URL mentioned in the intro text doesn't
work anymore. Reported by https://github.com/neovim/neovim/issues/36597#issue-3635391949.
Solution:
URL is removed from the text. We'll keep the vim.org URL for now as it
points to the same information.
[^1]: See June 2025 news on https://iccf-holland.org/index.html
Problem:
Can't use `:source` to run a Lua codeblock (treesitter injection) in
a help (vimdoc) file.
Solution:
Use treesitter to parse the range and treat it as Lua if detected as
such.
This commit updates `syntax/cangjie.vim` to match the latest `std.core`
library:
New Features:
* Documentation: Added highlighting for documentation keywords (e.g., `@param`, `@return`).
* Standard Library: Added highlighting for `std.core` functions, interfaces, and classes.
* Exceptions: Added highlighting for standard exception types.
* FFI Support: Added highlighting for C interoperability types (e.g., `CPointer`).
Improvements:
* Configuration: Added a unified switch (`s:enabled('builtin')`) for standard library highlighting.
* Type System: Updated `Int` and `UInt` aliases.
* Interpolation: Enabled standard library highlighting inside string interpolation.
* Cleanup: Removed non-core types like `ArrayList` and `HashMap`.
closes: vim/vim#1908577a59be594
Co-authored-by: Neila <wu.junkai@qq.com>
* fix(vim-patch): test_codestyle.vim is NA
Neovim has make lint, specifically clint.lua.
Unless vim9jit, https://github.com/tjdevries/vim9jit, or similar tool
compiles vim9 "test" code into lua, it's futile to port it.
* fix(vim-patch): NA files from dev_vimpatch.txt
- channel
- json
- job
- term
- terminal
Nvim has its own incompatible implementation or uses 3rd-party
libraries (ie. libuv, libtermkey).
* fix(vim-patch): term.c is applicable for replace_termcodes()
* fix(vim-patch/na): blowfish,dlldata,iid_ole,nbdebug,os_w32
blowfish is for encryption.
dlldata,iid_ole,os_w32 are for Windows (GUI, registry, entry point).
Nvim doesn't need them to be installed on Windows.
nbdebug.[ch] is for Netbeans Debugging Tools.
They're N/A.
* fix(vim-patch): runtime/
Nvim has its own documentation for development
- runtime/doc/debug.txt
- runtime/doc/develop.txt
N/A since the beginning:
- runtime/doc/os_haiku.txt
- runtime/doc/pi_logipat.txt
- runtime/doc/quotes.txt
- runtime/plugin/logiPat.vim
- runtime/plugin/manpager.vim
- runtime/tools/demoserver.py
- runtime/spell/.*\.latin1
Vim9 is N/A.
- runtime/doc/os_haiku.txt
* fix(vim-patch): src/
win32yank replaces "src/winclip.c".
Vim's desktop files are N/A.
Nvim removed 'termencoding'.
Nvim doesn't use Vim's lsan-suppress.txt to configures LSAN.
Add documentation notes explaining that visual marks '< and '> have
different behaviors in getpos() and setpos().
Also fix a small typo.
closes: vim/vim#1907093eb081eee
Co-authored-by: Larson, Eric <numeric.larson@gmail.com>
Problem:
`:lsp restart` detects when a client has exited by using the `LspDetach`
autocommand. This works correctly in common cases, but breaks when
restarting a client which is not attached to any buffer. It also breaks
if a client is detached in between `:lsp restart` and the actual
stopping of the client.
Solution:
Move restart logic into `vim/lsp/client.lua`, so it can hook in to
`_on_exit()`. The public `on_exit` callback cannot be used for this, as
`:lsp restart` needs to ensure the restart only happens once, even if
the command is run multiple times on the same client.
Problem:
We want to encourage implementing core features in Lua instead of C, but
it's clumsy because:
- Core Lua code (built into `nvim` so it is available even if VIMRUNTIME
is missing/invalid) requires manually updating CMakeLists.txt, or
stuffing it into `_editor.lua`.
- Core Lua modules are not organized similar to C modules, `_editor.lua`
is getting too big.
Solution:
- Introduce `_core/` where core Lua code can live. All Lua modules added
there will automatically be included as bytecode in the `nvim` binary.
- Move these core modules into `_core/*`:
```
_defaults.lua
_editor.lua
_options.lua
_system.lua
shared.lua
```
TODO:
- Move `_extui/ => _core/ui2/`
Problem:
Terminals should respond with the terminator (either BEL or ST) used in
the query so that clients can reliably parse the responses. The
`TermRequest` autocmd used to handle background color requests in the
terminal does not have access to the original sequence terminator, so it
always uses BEL. #37018
Solution:
Update vterm parsing to include the terminator type, then forward this
data into the emitted `TermRequest` events for OSC/DCS/APC sequences.
Update the foreground/background `TermRequest` callback to use the same
terminator as the original request.
Details:
I didn't add the terminator to the `TermResponse` event. However, I
assume the `TermResponse` event doesn't care about the terminator
because the sequence is already parsed. I also didn't update any of the
functions in `src/nvim/vterm/state.c` that write out responses. It
looked like those all pretty much used ST, and it would be a much larger
set of changes. In that same file, there's also logic for 8 bit ST
sequences, but from what I can tell, 8 bit doesn't really work (see `:h
xterm-8bit`), so I didn't use the 8 bit ST at all.
Problem: Deleting active plugins can lead to a situation when it is
reinstalled after restart.
Solution: Suggest "delete" code action only for not active plugins.
Whether a plugin is not active is visible by a hint in its header.
Problem: Using `vim.pack.del()` to delete active plugin can lead to
a situation when this plugin is reinstalled after restart. Removing
plugin from 'init.lua' is documented, but can be missed.
Solution: Make `del()` only remove non-active plugins by default and
throw an informative error if there is an active plugin.
Add a way to force delete any plugin by adding `opts.force`. This also
makes `del()` signature be the same as other functions, which is nice.
Problem: 'fsync' option cannot be set per buffer
Solution: Make 'fsync' option global-local
(glepnir)
closes: vim/vim#190194d5b303726
Co-authored-by: glepnir <glephunter@gmail.com>
Problem: There is now way to run `update()` without Internet connection
while there are some workflows that do not require it. Like "switch
plugin version" and "revert latest update".
Solution: Add `opts.offline` to `update()`. This also allows now to
treat `vim.pack.update(nil, { offline = true })` as a way to
interactively explore currently installed plugins.
Problem: There are two fairly common workflows that involve lockfile and
can be made more straightforward in `vim.pack`:
1. Revert latest update. Like if it introduced unwanted behavior.
2. Update to a revision in the lockfile. Like if already updated
on another machine, verified that everything works, `git add` +
`git commit` + `git push` the config, and want to have the same
plugin states on current machine.
Solution: Make `update` allow `opts.target`. By default it uses
`version` from a plugin specification (like a regular "get new changes
from source" workflow). But it also allows `"lockfile"` value to
indicate that target revision after update should be taken from the
current lockfile verbatim.
With this, the workflows are:
1. Revert (somehow) to the lockfile before the update, restart, and
`vim.pack.update({ 'plugin' }, { target = 'lockfile' })`. If Git
tracked, revert with `git checkout HEAD -- nvim-pack-lock.json`.
For non-VCS tracked lockfile, the revisions can be taken from the
log file. It would be nicer if `update()` would backup a lockfile
before doing an update, but that might require discussions.
2. `git pull` + `:restart` +
`vim.pack.update(nil, { target = 'lockfile' })`.
The only caveats are for new and deleted plugins:
- New plugins (not present locally but present in the lockfile)
will be installed at lockfile revision during restart.
- Deleted plugins (present locally but not present in the
lockfile) will still be present: both locally *and* in the
lockfile. They can be located by
`git diff -- nvim-pack-lock.json` and require manual
`vim.pack.del({ 'old-plugin1', 'old-plugin2' })`.
Problem:
`on_accept` is a bit cumbersome to customize.
Solution:
* Before: users had to override the entire `on_accept` logic for their changes to be applied.
* Now: users can modify the item and return it to apply the modified changes, or return `nil` to fully customize how the changes are applied.
Problem: Changing `src` of already installed plugin currently takes
effect immediately inside `vim.pack.add()` and acts as "delete and
later fresh install". Although more robust, this might lead to
unintentional data loss (since plugin is deleted) if the plugin was
manually modified or the new source is not valid.
Also this introduces unnecessary differentiation between "change
`version`" and "change `src`" of already installed plugin.
Solution: Require an explicit `vim.pack.update()` to change plugin's
source. It is done by conditionally changing `origin` remote of the
Git repo. The effect does not require update confirmation in order to
have new changes fetched from the new `src` right away.
If in the future there are more types of plugins supported (i.e. not
only Git repos), also do extra work (like delete + install) during
`vim.pack.update()`.
Problem: vim.keymap.del has 'modes' as it's first argument while vim.keymap.set
has 'mode' as it's first argument despite both 'mode' and 'modes' taking in the
same type input of String or String[].
Solution: Updated vim.keymap.set docs to refer to it's first argument
as 'modes'.
Problem:
- Despite [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig)
claims to be a "data-only" plugin, in fact it still provides some
user-facing commands because they haven't been upstreamed to Nvim.
Solution:
- Upstream `:LspRestart`, `:LspStart` and `:LspStop` commands as `:lsp
restart`, `:lsp start` and `:lsp stop` respectively.
Co-authored-by: glepnir <glephunter@gmail.com>
Problem:
The builtin terminfo defs don't include xterm-ghostty, so features like
`kTerm_set_underline_style` are missing when building without unibilium.
Solution:
- Add ghostty to `gen_terminfo.lua`.
- Note: The ncurses defs are somewhat different than what ghostty ships.
- Special-case ghostty in `terminfo_from_builtin`.
- Add leading "$" to match other environment variable tags.
- Clarify :help $NoDefaultCurrentDirectoryInExePath.
closes: vim/vim#18895bfb9f5c40e
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Problem:
After bc0635a9fc `vim.wait()` rejects floats
and NaN values.
Solution:
Restore the prior behavior, while still supporting `math.huge`. Update
tests to cover float case.
Problem:
Current options for powershell and pwsh had mistakes and rationale
behind them was not clear.
Solution:
Update the suggested options by splitting up powershell and pwsh, as
well as ensuring that all options work and rationale is documented and
discussed.