Nvim :help pages, generated
from source
using the tree-sitter-vimdoc parser.
buf parameter.
row, col) tuple
instead of returning them as separate values.
vim.opt.{option}:get() has improved structure for dict-like options.
Some shapes changed:
{ key = value } instead of an array of "key:value" strings.
,, literal-comma convention (e.g. 'isfname') is not reconstructed in
the structured view; the raw string value is unchanged.
%-20.20(...%).
:checkhealth vim.health.
<CR> by default; use g< or set
'messagesopt' "pager", e.g. :set messagesopt+=pager:<CR>.
cfg.pager_char and cfg.msg.msg.timeout were replaced by the
'messagesopt' items "pager" and "timeout".
"<Lua …>" hint string,
instead of nil.
vim.diagnostic.Opts.Status.format no longer accepts the table mapping
from severity to text. Use vim.diagnostic.Opts.Signs.text instead.
current_line property of vim.diagnostic.Opts.VirtualLines and
vim.diagnostic.Opts.VirtualText is now applied on CursorHold event.
Make sure your 'updatetime' is reasonable.
nvim -e) is a persistent cmdwin. This is much
more flexible and makes "Ex mode" more useful as a kind of "cmdline REPL",
with the tradeoff of dropping some POSIX Ex-mode quirks.
stdpath("log") moved to stdpath("state")/logs.
inoremap <Left> <C-o><Left>
inoremap <Right> <C-o><Right>
vim.keymap.set('n', 'Q', function()
local reg = vim.fn.reg_recorded()
return reg == '' and '' or ('@' .. reg)
end, { expr = true })
vim.lsp.ClientConfig.cmd given as a string array now uses
vim.lsp.ClientConfig.root_dir as its default process working directory.
client.attached_buffers[buf] now stores languageId string (was boolean).
nvim -ll was removed. Use -l script
mode instead.
vim.opt.wildignore + '*.o' + '*.obj'). Instead, use tables:
vim.opt.wildignore + {'*.o', '*.obj'}
%= item is no longer ignored in item groups. It applies
to the containing item group and its minwid.
An %< item inside an item group now only applies to the containing group
and its maxwid. Therefore, multiple %< can now be effective.
The default truncation of item groups is now at the first contained item.
To restore the previous truncation from the left, add a %< to the start.
The same applies to 'rulerformat', 'statuscolumn', 'tabline', 'winbar',
'titlestring', and 'iconstring'.
opts and any parameters thereafter, as optional
(equivalent to passing an empty dict). Clients may omit such optional
parameters.
opts and
any following parameters:-- Before:
vim.print(vim.api.nvim_get_mark('A', {}))
-- After:
vim.print(vim.api.nvim_get_mark('A'))
{lhs}, not {rhs}, with opts.lhs=true.
zindex controls whether the UI will use a dimmed cursor
shape when an unfocused float is on top of the cursor.
desc for Vimscript commands.
virt_lines_overflow accepts "wrap" to enable
wrapping onto extra rows and "auto" which enables horizontal scrolling when
'nowrap' is set and wrapping when 'wrap' is set.
virt_lines can extend the last hl in each virt_line
till the end of the line.
operation field to modify the
existing option value.
zig build -Dtarget=aarch64-macos
signs
field of vim.diagnostic.config(), if any.
virtual_lines.overflow in vim.diagnostic.config() controls
how virtual lines wider than the window are displayed.
set langmap=õ]
Dimmed for text that should be de-emphasized.
vim.hl.on_yank().
CompletionItem.preselect if 'completeopt' has
"preselect". https://microsoft.github.io/language-server-protocol/specification/#completionClientCapabilities
textDocument/foldingRange vim.lsp.foldtext() highlights collapsed text.
https://microsoft.github.io/language-server-protocol/specification/#textDocument_foldingRange
CompletionList.applyKind: a server can ask for
commitCharacters and data from itemDefaults to be merged with the
item's own values instead of replacing them.
https://microsoft.github.io/language-server-protocol/specification/#completionItemApplyKinds
completionProvider registered with
client/registerCapability instead of declared at initialize. Nvim does
not advertise completion.dynamicRegistration by default; set it in
vim.lsp.Config capabilities to opt in.
https://microsoft.github.io/language-server-protocol/specification/#client_registerCapability
:checkhealth vim.lsp highlights the "current buffer".
commitCharacters: typing a commit character
while a completion item is selected accepts the item as with
complete_CTRL-Y, then inserts the character. Previously
commitCharacters had no effect.
textDocument/formatting if the whole
buffer is being formatted and the language server doesn't support
textDocument/rangeFormatting.
timeout_ms with async=true.
The timeout applies per client. Async requests have no timeout when the
option is omitted.
workspace/foldingRange/refresh:
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#workspace_foldingRange_refresh
vim.async provides structured concurrency primitives for Lua
code, including task handles, await helpers, cooperative cancellation,
completion-order iteration, and semaphores.
:checkhealth vim.health to confirm
your terminal supports it.
opts.headers.
method param overload for multiple HTTP methods.
opts.err=true, reports errors. An inaccessible root
dir yields a single (name, nil, err) item.
plain parameter.
opts.parents=true.
__eq metamethod to vim.VersionRange. 2 distinct but representing
the same range instances now compare equal.
vim.o.operatorfunc), expr-option-function
(e.g. vim.wo.foldexpr, vim.bo.indentexpr). Reading such an option:
"<Lua …>" hint string.
%= item is supported within item groups to separate alignment sections
within the containing group until its minwid is reached. The truncation
of an item group to its maxwid can be controlled with the %< item.
The same applies to 'rulerformat', 'statuscolumn', 'tabline', 'winbar',
'titlestring', and 'iconstring'.
vim.fn
functions, which skips the Vimscript <=> Lua "bridge" (no data
conversion/marshalling) entirely, if the vim.fn function is called from
Lua.
table.clear, which reduces GC and
memory reallocation during each data reset.
@noconceal
capture.
diff treesitter parser is bundled.
fnamemodify(':h') preserves logical roots for more path formats.
info=true returns details for each server (own + peers).
nvim_exec_autocmds({buf=…}) runs in the context of the target buffer.
filetype=directory
buffer. See dir.
@string.escape capture.
opts.expand_env=false key was renamed to
opts.plain=true and now does not expand leading tildes ("~") in addition
to environment variables ("expand_env" is still accepted, for backwards
compatibility).
:helptags ALL reports E152 for "doc" directories it cannot write,
instead of silently skipping them.
opts.keep_cursor, to hold the
cursor on the text it is on while edits move around it.
reuse_win option.