News
Nvim :help pages, generated
from source
using the tree-sitter-vimdoc parser.
Notable changes since Nvim 0.11
For changes in the previous release, see
news-0.11.
====== Remove this section before release. ======
The following changes to UNRELEASED features were made during the development
cycle (Nvim HEAD, the "master" branch).
EVENTS
EXPERIMENTS
LSP
OPTIONS
'completefuzzycollect' and 'isexpand' have been removed.
TREESITTER
UI
progress attribute removed from
ui-messages msg_show event
VIMSCRIPT
complete_match() has been removed.
These changes may require adaptations in your config or plugins.
API
Decoration provider has on_range() callback.
BUILD
DIAGNOSTICS
EDITOR
i_CTRL-R inserts named/clipboard registers (A-Z,a-z,0-9+) literally, like
pasting instead of like user input. Improves performance, avoids broken
formatting. To get the old behavior you can use
<C-R>=@x.
Buffer name URI scheme parsing more closely follows RFC3986, so for example
"svn+ssh:", "ed2k:", and "iris.xpc:" are recognized as URI schemes.
On Windows, Nvim no longer searches the current directory for executables
for running external commands; prefix a relative or absolute path if you
want the old behavior
$NoDefaultCurrentDirectoryInExePath.
EVENTS
ui-messages no longer emits the
msg_show.return_prompt, and
msg_history_clear events. The
msg_clear event was repurposed and is now
emitted after the screen is cleared. These events arbitrarily assumed a
message UI that mimics the legacy message grid. Benefit: reduced UI event
traffic and more flexibility for UIs.
The
msg_history_show event has an additional "prev_cmd" argument.
HIGHLIGHTS
LSP
JSON "null" values in LSP messages are represented as
vim.NIL instead of
nil.
Missing fields (as opposed to JSON "null") are still represented as
nil.
Renamed vim.lsp.semantic_tokens start()/stop() to enable().
Values < 0 are now treated as nil instead of 0.
Values outside the range of signatures[activeSignature].parameters
are now treated as nil instead of #signatures[activeSignature].parameters
LUA
Renamed vim.diff to vim.text.diff.
OPTIONS
PLUGINS
Removed "shellmenu" plugin, an old menu-based quasi-snippet plugin for shell scripts.
TREESITTER
treesitter-directive-offset! can now be applied to quantified captures. It
no longer sets
metadata[capture_id].range; it instead sets
metadata[capture_id].offset. The offset will be applied in
vim.treesitter.get_range(), which should be preferred over reading
metadata directly for retrieving node ranges.
TUI
VIMSCRIPT
The following new features were added.
API
api-contract allows existing functions to change return-type from
void => non-void.
nvim_win_text_height() can limit the lines checked when a certain
max_height is reached, and returns the
end_row and
end_vcol for which
max_height or the calculated height is reached.
vim.secure.read() now returns
true for trusted directories. Previously
it would return
nil, thus impossible to tell if the directory was actually
trusted.
nvim_ui_send() writes arbitrary data to a UI's stdout. Use this to write
escape sequences to the terminal when Nvim is running in the
TUI.
nvim_get_commands() returns
preview and
callback as Lua functions if
they were so specified in
nvim_create_user_command().
nvim_open_win() floating windows can show a
'statusline'. Plugins can use
style='minimal' or
:setlocal statusline= to hide the statusline.
Added experimental
nvim__exec_lua_fast() to allow remote API clients to
execute code while nvim is blocking for input.
BUILD
A Zig-based build system has been added as an alternative to CMake. It is
currently limited in functionality, and CMake remains the recommended option
for the time being.
Nvim can be built without Unibilium (terminfo implementation), in which case
the user's terminfo database won't be loaded and only internal definitions
for the most common terminals are used:
make distclean && make CMAKE_EXTRA_FLAGS="-DENABLE_UNIBILIUM=0" DEPS_CMAKE_FLAGS"-DUSE_BUNDLED_UNIBILIUM=0"
On Windows, tee.exe is installed with nvim.exe by default so that
commands like :make, :grep work out of the box.
DEFAULTS
'diffopt' default value now includes "indent-heuristic" and "inline:char".
'statusline' default is exposed as a statusline expression (previously it
was implemented as an internal C routine).
Project-local configuration (
'exrc') is also loaded from parent directories.
Unset
'exrc' to stop further search.
Mappings:
'shada' default now excludes "/tmp/" and "/private/" paths to reduce clutter in
:oldfiles.
Enabled treesitter highlighting for Markdown files
DIAGNOSTICS
EDITOR
:retab accepts new optional parameter -indentonly to only change leading
whitespace in indented lines.
:uniq deduplicates text in the current buffer.
Setting "'0" in
'shada' prevents storing the jumplist in the shada file.
'shada' now correctly respects "/0" and "f0".
prompt-buffer supports multiline input/paste, undo/redo, and o/O normal
commands.
For security,
'exrc' no longer shows "(a)llow". Instead you must "(v)iew",
then run
:trust (or
:trust [file], but that has a TOCTOU risk).
gx in help buffers opens the online documentation for the tag under the
cursor.
:source with a range in non-Lua files (e.g., vimdoc) now detects Lua
codeblocks via treesitter and executes them as Lua instead of Vimscript.
:wall permits a
++p option for creating parent directories when writing
changed buffers.
The
:DiffTool command compares directories (and files).
EVENTS
A new empty message kind is emitted for an empty (e.g. :echo "") message.
New
append,
id and
trigger parameter for
ui-messages msg_show event.
'rulerformat' is emitted as
msg_ruler when not part of the statusline.
MarkSet is triggered after a
mark is set by the user (currently doesn't
support implicit marks like
'[ or
'<, …).
HIGHLIGHTS
LSP
:lsp can be used to interactively manage LSP clients.
The textDocument/diagnostic request now includes the previous id in its
parameters.
vim.lsp.enable() start/stops clients as necessary and detaches
non-applicable LSP clients.
Incremental selection is now supported via textDocument/selectionRange.
an selects outwards and in selects inwards.
Support for multiline semantic tokens.
Support for the disabled field on code actions.
The function form of cmd in a vim.lsp.Config or vim.lsp.ClientConfig
receives the resolved config as the second arg: cmd(dispatchers, config).
Support for annotated text edits.
:checkhealth vim.lsp is now available to check which buffers the active LSP features are attached to.
LSP
DiagnosticRelatedInformation is now shown in
vim.diagnostic.open_float(). It is read from the LSP diagnostic object
stored in the
user_data field.
When inside the float created by
vim.diagnostic.open_float() and the
cursor is on a line with
DiagnosticRelatedInformation,
gf can be used to
jump to the problematic location.
exit_timeout graduated from "experimental" flags.exit_timeout
to a top-level field. Defaults to false.
Client:stop() accepts
force as an integer, which is treated as the time
to wait before before stop escalates to force-stop.
Supports colored symbol preview for color items.
Shows a preview ("completionItem/resolve") if
'completeopt' has "popup".
Support for dynamic registration for textDocument/diagnostic
Support for textDocument/semanticTokens/range.
Code lenses now display as virtual lines
gx opens
textDocument/documentLink items found at cursor.
LUA
Lua type annotations for vim.uv.
Experimental vim.pos and vim.range for Position/Range abstraction.
OPTIONS
'autowriteall' writes all buffers upon receiving
SIGHUP,
SIGQUIT or
SIGTSTP.
"F{func}" complete using given function
'complete' allows limiting matches for sources using "{flag}^<limit>".
'completeopt' flag "nearest" sorts completion results by distance to cursor.
'diffopt' inline: configures diff highlighting for changes within a line.
g:clipboard accepts a string name to force any builtin clipboard tool.
'busy' sets a buffer "busy" status. Indicated in the default statusline.
g:clipboard autodetection only selects tmux when running inside tmux
'statusline' allows "stacking" highlight groups (groups inherit from
previous highlight attributes)
vim.glob.to_lpeg() uses a new LPeg-based implementation (Peglob) that
provides ~50% speedup for complex patterns. The implementation restores
support for nested braces and follows LSP 3.17 specification with
additional constraints for improved correctness and resistance to
backtracking edge cases.
i_CTRL-R inserts named/clipboard registers literally, 10x speedup.
LSP textDocument/semanticTokens/range is supported, which requests tokens
for the viewport (visible screen) only.
:packadd doesn't invalidate the cached Lua package path. Instead the cache
gets updated in place. This might make a big startuptime difference for
certain
init.lua patterns where multiple
:packadd or
vim.pack.add()
calls are interspersed with other code.
PLUGINS
Customize :checkhealth by handling a
FileType checkhealth event.
health-usage
Simplify Python provider setup to a single step:
uv tool install pynvim
Nvim will detect the plugin's location without user configuration, even if
unrelated Python virtual environments are activated.
provider-python
STARTUP
v:argf provides file arguments given at startup.
TERMINAL
nvim_open_term() can be called with a non-empty buffer. The buffer
contents are piped to the PTY and displayed as terminal output.
CSI 3 J (the sequence to clear terminal scrollback) is now supported.
A suspended PTY process is now indicated by "[Process suspended]" at the
bottom-left of the buffer and can be resumed by pressing a key.
On terminal exit, "[Process exited]" is shown as virtual text (instead of
modifying buffer contents), and exit code is shown in statusline.
TREESITTER
:EditQuery command gained tab-completion, works with injected languages.
TUI
Native progress bars are displayed for
Progress events using the OSC 9;4
sequence.
The TUI now renders the SGR dim (faint), blink, conceal, and overline
attributes.
UI
ui2 is a redesign of the core messages and commandline UI, which will
replace the legacy message grid in the TUI.
Avoids "Press ENTER" interruptions.
Avoids delays from
W10 "Changing a readonly file" and other warnings.
Highlights the cmdline as you type.
Provides the
pager as a buffer + window.
Currently experimental. To enable it: require('vim._core.ui2').enable()
:restart restarts Nvim and reattaches the current UI.
:connect dynamically connects the current UI to the server at the given
address.
:checkhealth shows a summary in the header for every healthcheck.
ui-multigrid provides composition information and absolute coordinates.
Error messages are more concise:
"Error detected while processing:" changed to "Error in:".
"Error executing Lua:" changed to "Lua:".
'busy' status is shown in default statusline with symbol ◐
Cursor shape indicates when it is behind an unfocused floating window.
Improved LSP signature help rendering.
Multigrid UIs can call nvim_input_mouse with grid 0 to let Nvim decide the grid.
VIMSCRIPT
chdir() allows optionally specifying a scope argument.
These existing features changed their behavior.
'pumblend' does not apply special attributes (bold, underline) from the
background layer to the foreground layer.
gv works in operator pending mode and does not abort.
'spellfile' location defaults to
stdpath("data").."/site/spell/" instead of
the first writable directory in
'runtimepath'.
$VIM and
$VIMRUNTIME no longer check for Vim version-specific runtime
directory
vim{number} (e.g.
vim82).
Windows: Paths like "\Windows" and "/Windows" are now considered to be
absolute paths (to the current drive) and no longer relative.
When
'shelltemp' is off, shell commands now use
pipe() and not
socketpair()
for input and output. This matters mostly for Linux where some command lines
using "/dev/stdin" and similiar would break as these special files can be
reopened when backed by pipes but not when backed by socket pairs.
These deprecated features were removed.