News-0.9
Nvim :help
pages, generated
from source
using the tree-sitter-vimdoc parser.
Notable changes since Nvim 0.8
BREAKING CHANGES
The following changes may require adaptations in user config or plugins.
Commands removed:
:cscope
:lcscope
:scscope
:cstag
Options removed:
cscopepathcomp
cscopeprg
cscopequickfix
cscoperelative
cscopetag
cscopetagorder
cscopeverbose
Eval functions removed:
cscope_connection()
Note: support for
ctags remains with no plans to remove.
Commands removed:
:hardcopy
Options removed:
printdevice
printencoding
printexpr
printfont
printheader
printmbcharset
'paste' option is now deprecated and
'pastetoggle' is removed.
paste works
automatically in GUI and terminal (TUI) Nvim. Just Paste It.™
It now returns string
, as opposed to string|string[]|nil
.
The concat
option has been removed as it was not consistently applied.
Invalid ranges now cause an error instead of returning nil
.
help
treesitter parser was renamed to vimdoc
. The only user-visible
change is that language-specific highlight groups need to be renamed from
@foo.help
to @foo.vimdoc
.
libiconv and intl are now required build dependencies.
NEW FEATURES
The following new APIs or features were added.
Treesitter syntax highlighting for
help
files now supports highlighted
code examples. To enable, create a
.config/nvim/ftplugin/help.lua
with
the contents
vim.treesitter.start()
Note: Highlighted code examples are only available in the Nvim manual, not
in help files taken from Vim. The treesitter vimdoc
parser is also work in
progress and not guaranteed to correctly highlight every help file in the
wild.
Added support for semantic token highlighting to the LSP client. This
functionality is enabled by default when a client that supports this feature
is attached to a buffer. Opt-out can be performed by deleting the
semanticTokensProvider
from the LSP client's {server_capabilities}
in the
LspAttach
callback.
vim.inspect_pos(),
vim.show_pos() and
:Inspect allow a user to get or show items
at a given buffer position. Currently this includes treesitter captures,
LSP semantic tokens, syntax groups and extmarks.
'statuscolumn' option to customize the area to the side of a window,
normally containing the fold, sign and number columns. This new option follows
the
'statusline' syntax and can be used to transform the line numbers, create
mouse click callbacks for
signs, introduce a custom margin or separator etc.
EditorConfig support is now builtin. This is enabled by default and happens
automatically. To disable it, users should add
vim.g.editorconfig = false
(or the Vimscript equivalent) to their
config file.
A new environment variable named NVIM_APPNAME enables configuring the
directories where Nvim should find its configuration and state files. See
:help $NVIM_APPNAME
.
Added support for running Lua scripts from shell using
-l.
nvim -l foo.lua --arg1 --arg2
Also works with stdin:
echo "print(42)" | nvim -l -
Added a new experimental
vim.loader that byte-compiles and caches Lua files.
To enable the new loader, add the following at the top of your
init.lua:
vim.loader.enable()
Added
vim.version for parsing and comparing version strings conforming to
the semver specification.
When using Nvim inside tmux 3.2 or later, the default clipboard provider
will now copy to the system clipboard.
provider-clipboard
'splitkeep' option to control the scroll behavior of horizontal splits.
'diffopt' now includes a
linematch
option to enable a second-stage diff on
individual hunks to provide much more accurate diffs. This option is also
available to
vim.diff()
--remote-ui option was added to connect to a remote instance and display
in it in a
TUI in the local terminal. This can be used run a headless nvim
instance in the background and display its UI on demand, which previously
only was possible using an external UI implementation.
Added support for the willSave
and willSaveWaitUntil
capabilities to the
LSP client. willSaveWaitUntil
allows a server to modify a document before it
gets saved. Example use-cases by language servers include removing unused
imports, or formatting the file.
Added preliminary support for the workspace/didChangeWatchedFiles
capability
to the LSP client to notify servers of file changes on disk. The feature is
disabled by default and can be enabled by setting the
workspace.didChangeWatchedFiles.dynamicRegistration=true
capability.
vim.diagnostic.is_disabled() checks if diagnostics are disabled in a given
buffer or namespace.
Treesitter captures can now be transformed by directives. This will allow
more complicated dynamic language injections.
Expanded the TSNode API with:
Additionally
TSNode:range() now takes an optional
{include_bytes}
argument.
require'bit'
is now always available
lua-bit
CHANGED FEATURES
The following changes to existing APIs or features add new behavior.
'exrc' now supports
.nvim.lua
file.
'exrc' is no longer marked deprecated.
The
TUI is changed to run in a separate process (previously, a separate
thread was used). This is not supposed to be a visible change to the user,
but might be the cause of subtle changes of behavior and bugs.
Previously, the TUI could be disabled as a build time feature (+tui/-tui),
resulting in a nvim binary which only could be run headless or embedded
in an external process. As of this version, TUI is always available.
Vim's
has('gui_running')
is now supported as a way for plugins to check if
a GUI (not the
TUI) is attached to Nvim.
has()
msgsep is now always enabled even if
'display' doesn't contain the "msgsep"
flag. It is no longer possible to scroll the whole screen when showing
messages longer than
'cmdheight'.
API calls now show more information about where an exception happened.
The win_viewport
UI event now contains information about virtual lines,
meaning that smooth scrolling can now be implemented more consistently.
The
:= {expr}
syntax can be used to evaluate a Lua expression, as
a shorter form of
:lua ={expr}
.
:=
and
:[range]=
without argument
are unchanged. However
:=#
and similar variants using
ex-flags
are no longer supported.
Unsaved changes are now preserved rather than discarded when
channel-stdio
is closed.
nvim_open_win() now accepts a relative
mouse
option to open a floating win
relative to the mouse. Note that the mouse doesn't update frequently without
setting
vim.o.mousemoveevent = true
nvim_buf_get_extmarks() now accepts a -1
ns_id
to request extmarks from
all namespaces and adds the namespace id to the details array.
Other missing properties have been added to the details array and marks can
be filtered by type.
vim.fs.dir() now has a
opts
argument with a depth field to allow
recursively searching a directory tree.
:highlight now supports an additional attribute "altfont".
:Man manpage viewer supports manpage names containing spaces.
build: Several improvements were made to make the code generation scripts more
deterministic, and a LUA_GEN_PRG
build parameter has been introduced to
allow for a workaround for some remaining reproducibility problems.
REMOVED FEATURES
The following deprecated functions or APIs were removed.
LanguageTree:parse() no longer returns changed regions. Please use the
on_changedtree
callbacks instead.
vim.highlight.create()
,
vim.highlight.link()
were removed, use
nvim_set_hl() instead.
require'health'
was removed. Use
vim.health instead.
DEPRECATIONS