mirror of
https://github.com/neovim/neovim.git
synced 2026-08-30 19:11:52 +00:00
docs: news #38464
This commit is contained in:
@@ -1573,6 +1573,8 @@ nvim_set_hl({ns_id}, {name}, {val}) *nvim_set_hl()*
|
||||
exists.
|
||||
• link: Name of highlight group to link to. |:hi-link|
|
||||
• sp: color name or "#RRGGBB"
|
||||
• update: boolean (default false) Update specified attributes
|
||||
only, leave others unchanged.
|
||||
• altfont: boolean
|
||||
• blink: boolean
|
||||
• bold: boolean
|
||||
@@ -1590,8 +1592,6 @@ nvim_set_hl({ns_id}, {name}, {val}) *nvim_set_hl()*
|
||||
• underdotted: boolean
|
||||
• underdouble: boolean
|
||||
• underline: boolean
|
||||
• update: boolean false by default; true updates only
|
||||
specified attributes, leaving others unchanged.
|
||||
|
||||
nvim_set_hl_ns({ns_id}) *nvim_set_hl_ns()*
|
||||
Set active namespace for highlights defined with |nvim_set_hl()|. This can
|
||||
|
||||
@@ -17,12 +17,12 @@ DEPRECATED IN 0.12 *deprecated-0.12*
|
||||
|
||||
API
|
||||
|
||||
• todo
|
||||
• nvim_set_decoration_provider `on_line` Use `on_range` instead.
|
||||
|
||||
DIAGNOSTICS
|
||||
|
||||
• "float" in |vim.diagnostic.JumpOpts|. Use "on_jump" instead.
|
||||
• "float" in |vim.diagnostic.Opts.Jump|. Use "on_jump" instead.
|
||||
• "float" in |vim.diagnostic.JumpOpts|. Use `on_jump` instead.
|
||||
• "float" in |vim.diagnostic.Opts.Jump|. Use `on_jump` instead.
|
||||
|
||||
HIGHLIGHTS
|
||||
|
||||
@@ -58,10 +58,6 @@ UI
|
||||
• *hit-enter* *hit-enter-prompt* With |ui2|, the legacy "Press ENTER"
|
||||
*press-enter prompt is never triggered.
|
||||
|
||||
VIMSCRIPT
|
||||
|
||||
• todo
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
DEPRECATED IN 0.11 *deprecated-0.11*
|
||||
|
||||
|
||||
@@ -2096,8 +2096,8 @@ vim.tbl_filter({fn}, {t}) *vim.tbl_filter()*
|
||||
(`any[]`) Table of filtered values
|
||||
|
||||
vim.tbl_get({o}, {...}) *vim.tbl_get()*
|
||||
Index into a table (first argument) via string keys passed as subsequent
|
||||
arguments. Return `nil` if the key does not exist.
|
||||
Gets a value from (nested) table `o` given by the sequence of keys `...`,
|
||||
or `nil` if not found.
|
||||
|
||||
Examples: >lua
|
||||
vim.tbl_get({ key = { nested_key = true }}, 'key', 'nested_key') == true
|
||||
@@ -2246,7 +2246,8 @@ vim.validate({name}, {value}, {validator}, {optional}, {message})
|
||||
`'userdata'`.
|
||||
• (`fun(val:any): boolean, string?`) A function that
|
||||
returns a boolean and an optional string message.
|
||||
• {optional} (`boolean?`) Argument is optional (may be omitted)
|
||||
• {optional} (`boolean?`) Parameter is optional (may be omitted or
|
||||
nil)
|
||||
• {message} (`string?`) message when validation fails
|
||||
|
||||
Overloads: ~
|
||||
@@ -2454,6 +2455,13 @@ vim.filetype.match({args}) *vim.filetype.match()*
|
||||
Lua module: vim.fs *vim.fs*
|
||||
|
||||
|
||||
*vim.fs.copy()*
|
||||
Use |filecopy()| or |uv.fs_copyfile()| to performantly copy an existing file.
|
||||
|
||||
Example: >lua
|
||||
vim.fn.filecopy('foo.txt', 'bar.txt')
|
||||
<
|
||||
|
||||
*vim.fs.exists()*
|
||||
Use |uv.fs_stat()| to check a file's type, and whether it exists.
|
||||
|
||||
@@ -3581,9 +3589,10 @@ vim.json.encode({obj}, {opts}) *vim.json.encode()*
|
||||
• {opts} (`table?`) A table with the following fields:
|
||||
• {escape_slash}? (`boolean`, default: `false`) Escape slash
|
||||
characters "/" in string values.
|
||||
• {indent}? (`string`, default: `""`) If non-empty, the
|
||||
returned JSON is formatted with newlines and whitespace,
|
||||
where `indent` defines the whitespace at each nesting level.
|
||||
• {indent}? (`string`, default: `""`) If non-empty, each value
|
||||
in a JSON object or array starts on a new line and is
|
||||
prefixed with `indent` per nesting level. Adds a space after
|
||||
colons. Does not add a final newline.
|
||||
• {sort_keys}? (`boolean`, default: `false`) Sort object keys
|
||||
in alphabetical order.
|
||||
|
||||
@@ -5074,16 +5083,13 @@ vim.ui.select({items}, {opts}, {on_choice}) *vim.ui.select()*
|
||||
|
||||
Example: >lua
|
||||
vim.ui.select({ 'tabs', 'spaces' }, {
|
||||
prompt = 'Select tabs or spaces:',
|
||||
format_item = function(item)
|
||||
return "I'd like to choose " .. item
|
||||
end,
|
||||
prompt = 'Select tabs or spaces:',
|
||||
format_item = function(item)
|
||||
return ('I choose %s!'):format(item)
|
||||
end,
|
||||
}, function(choice)
|
||||
if choice == 'spaces' then
|
||||
vim.o.expandtab = true
|
||||
else
|
||||
vim.o.expandtab = false
|
||||
end
|
||||
vim.o.expandtab = choice == 'spaces'
|
||||
vim.print(('Selected "%s" => expandtab=%s'):format(choice, vim.o.expandtab))
|
||||
end)
|
||||
<
|
||||
|
||||
@@ -5461,7 +5467,8 @@ and their respective buffers.
|
||||
Unlike the legacy |hit-enter| prompt, messages exceeding 'cmdheight' are
|
||||
instead "collapsed", followed by a `[+x]` "spill" indicator, where `x`
|
||||
indicates the spilled lines. To see the full messages, do either:
|
||||
• ENTER while cmdline is expanded (not in |Insert-mode| and |Terminal-mode|).
|
||||
• ENTER immediately after interactive |:| cmdline shows a message and returns
|
||||
to |Normal-mode|.
|
||||
• |g<| at any time.
|
||||
|
||||
vim:tw=78:ts=8:sw=4:sts=4:et:ft=help:norl:
|
||||
|
||||
@@ -10,53 +10,6 @@ For changes in the previous release, see |news-0.11|.
|
||||
|
||||
Type |gO| to see the table of contents.
|
||||
|
||||
==============================================================================
|
||||
BREAKING CHANGES IN HEAD OR EXPERIMENTAL *news-breaking-dev*
|
||||
|
||||
====== Remove this section before release. ======
|
||||
|
||||
The following changes to UNRELEASED features were made during the development
|
||||
cycle (Nvim HEAD, the "master" branch).
|
||||
|
||||
EVENTS
|
||||
|
||||
• Renamed "nvim.find_exrc" |default-autocmds| group to "nvim.exrc".
|
||||
|
||||
EXPERIMENTS
|
||||
|
||||
• todo
|
||||
|
||||
LUA
|
||||
|
||||
• |vim.net.request()| does not set the response body to `true` if an output
|
||||
buffer is supplied.
|
||||
|
||||
LSP
|
||||
|
||||
• |vim.lsp.buf.selection_range()| now accepts an integer which specifies its
|
||||
direction, rather than a string `'outer'` or `'inner'`.
|
||||
|
||||
DIAGNOSTICS
|
||||
|
||||
• |vim.diagnostic.Opts.Status|.text was removed in favour of
|
||||
|vim.diagnostic.Opts.Status|.format.
|
||||
|
||||
OPTIONS
|
||||
|
||||
• `'completefuzzycollect'` and `'isexpand'` have been removed.
|
||||
|
||||
TREESITTER
|
||||
|
||||
• todo
|
||||
|
||||
UI
|
||||
|
||||
• `progress` attribute removed from |ui-messages| msg_show event
|
||||
|
||||
VIMSCRIPT
|
||||
|
||||
• `complete_match()` has been removed.
|
||||
|
||||
==============================================================================
|
||||
BREAKING CHANGES *news-breaking*
|
||||
|
||||
@@ -64,20 +17,15 @@ These changes may require adaptations in your config or plugins.
|
||||
|
||||
API
|
||||
|
||||
• Decoration provider has `on_range()` callback.
|
||||
• |nvim_get_commands()| returns `complete` as a Lua function, if it was
|
||||
defined as such.
|
||||
|
||||
BUILD
|
||||
|
||||
• todo
|
||||
|
||||
DIAGNOSTICS
|
||||
|
||||
• |diagnostic-signs| can no longer be configured with |:sign-define| or
|
||||
|sign_define()| (deprecated in Nvim 0.10 |deprecated-0.10|).
|
||||
• |vim.diagnostic.disable()| and |vim.diagnostic.is_disabled()| (deprecated in
|
||||
Nvim 0.10 |deprecated-0.10|) are removed.
|
||||
• Removed |vim.diagnostic.disable()| and |vim.diagnostic.is_disabled()|
|
||||
(deprecated in Nvim 0.10 |deprecated-0.10|).
|
||||
• The legacy signature of |vim.diagnostic.enable()| (deprecated in Nvim 0.10
|
||||
|deprecated-0.10|) is no longer supported.
|
||||
|
||||
@@ -86,10 +34,10 @@ 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
|
||||
• Parsing of URI-like buffer names 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
|
||||
• Security: Nvim on Windows no longer searches the current directory for
|
||||
external command executables; prefix a relative or absolute path if you
|
||||
want the old behavior |$NoDefaultCurrentDirectoryInExePath|.
|
||||
|
||||
EVENTS
|
||||
@@ -101,10 +49,6 @@ EVENTS
|
||||
traffic and more flexibility for UIs.
|
||||
The `msg_history_show` event has an additional "prev_cmd" argument.
|
||||
|
||||
HIGHLIGHTS
|
||||
|
||||
• todo
|
||||
|
||||
LSP
|
||||
|
||||
• JSON "null" values in LSP messages are represented as |vim.NIL| instead of `nil`.
|
||||
@@ -134,8 +78,7 @@ PLUGINS
|
||||
|
||||
TREESITTER
|
||||
|
||||
• The |vim.treesitter.query.lint()| is no longer enabled by default in the
|
||||
|ft-query-plugin|.
|
||||
• |ft-query-plugin| no longer enables |vim.treesitter.query.lint()| by default.
|
||||
• |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
|
||||
@@ -144,14 +87,6 @@ TREESITTER
|
||||
• The "all" option to |Query:iter_matches()|, which was introduced in Nvim
|
||||
0.11 to aid in transitioning to the new behavior, has been removed.
|
||||
|
||||
TUI
|
||||
|
||||
• todo
|
||||
|
||||
VIMSCRIPT
|
||||
|
||||
• todo
|
||||
|
||||
==============================================================================
|
||||
NEW FEATURES *news-features*
|
||||
|
||||
@@ -176,24 +111,23 @@ API
|
||||
• |nvim_open_win()| floating windows can show a 'statusline'. Plugins can use
|
||||
`style='minimal'` or `:setlocal statusline=` to hide the statusline.
|
||||
• |nvim_win_set_config()| can move |floating-windows| to other tabpages.
|
||||
• Added experimental |nvim__exec_lua_fast()| to allow remote API clients to
|
||||
execute code while nvim is blocking for input.
|
||||
• EXPERIMENTAL: |nvim__exec_lua_fast()| allows remote API clients to execute
|
||||
Lua while Nvim is blocking for input. |api-fast|
|
||||
• Decoration provider gained an `on_range` callback (deprecates `on_line`).
|
||||
• |vim.secure.trust()| accepts `path` for the `allow` action.
|
||||
• |nvim_get_chan_info()| includes `exitcode` field for terminal buffers
|
||||
• |nvim_get_chan_info()| includes `exitcode` field for :terminal buffers.
|
||||
• |nvim_set_hl()| supports updating specified attributes only.
|
||||
|
||||
BUILD
|
||||
|
||||
• A Zig-based build system has been added as an alternative to CMake. It is
|
||||
• EXPERIMENTAL: Zig-based build is available 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
|
||||
make distclean && make CMAKE_EXTRA_FLAGS="-DENABLE_UNIBILIUM=0" DEPS_CMAKE_FLAGS="-DUSE_BUNDLED_UNIBILIUM=0"
|
||||
• On Windows, `tee.exe` is included with `nvim.exe` by default so that
|
||||
commands like :make, :grep work out of the box.
|
||||
|
||||
DEFAULTS
|
||||
@@ -201,15 +135,17 @@ 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).
|
||||
• 'statusline' includes |vim.diagnostic.status()|
|
||||
• 'statusline' shows exit code of finished terminal buffers
|
||||
• Default 'statusline' shows:
|
||||
• |vim.diagnostic.status()|
|
||||
• |vim.ui.progress_status()
|
||||
• :terminal exit code
|
||||
• Project-local configuration ('exrc') is also loaded from parent directories.
|
||||
Unset 'exrc' to stop further search.
|
||||
• Mappings:
|
||||
• |grt| in Normal mode maps to |vim.lsp.buf.type_definition()|
|
||||
• |grx| in Normal mode maps to |vim.lsp.codelens.run()|
|
||||
• 'shada' default now excludes "/tmp/" and "/private/" paths to reduce clutter in |:oldfiles|.
|
||||
• Enabled treesitter highlighting for Markdown files
|
||||
• Enabled treesitter highlighting for Markdown files.
|
||||
|
||||
DIAGNOSTICS
|
||||
|
||||
@@ -218,10 +154,10 @@ DIAGNOSTICS
|
||||
location/quickfix list.
|
||||
• |vim.diagnostic.get()| now accepts an `enabled` filter to only return
|
||||
enabled or disabled diagnostics.
|
||||
• |vim.diagnostic.status()| returns a formatted string with current buffer
|
||||
diagnostics
|
||||
• |vim.diagnostic.fromqflist()| now accepts an `opts` table with
|
||||
`merge_lines` to merge multi-line compiler messages.
|
||||
• |vim.diagnostic.status()| returns a status description of current buffer
|
||||
diagnostics.
|
||||
• |vim.diagnostic.fromqflist()| accepts `opts.merge_lines` to merge multiline
|
||||
compiler messages.
|
||||
|
||||
EDITOR
|
||||
|
||||
@@ -229,7 +165,7 @@ EDITOR
|
||||
• |:retab| accepts new optional parameter -indentonly to only change leading
|
||||
whitespace in indented lines.
|
||||
• |:uniq| deduplicates text in the current buffer.
|
||||
• |omnicompletion| in `help` buffer. |ft-help-omni|
|
||||
• |omnicompletion| is available when editing |help| buffers. |ft-help-omni|
|
||||
• |:help!| has DWIM ("Do What I Mean") behavior: it tries to guess the help
|
||||
tag at cursor. In help buffers, 'keywordprg' defaults to ":help!". For
|
||||
example, try "K" anywhere in this code: >
|
||||
@@ -240,20 +176,18 @@ EDITOR
|
||||
commands.
|
||||
• 'wildchar' now enables completion in search contexts using |/|, |?|, |:g|, |:v|
|
||||
and |:vimgrep| commands.
|
||||
• For security, 'exrc' no longer shows "(a)llow". Instead you must "(v)iew",
|
||||
• 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.
|
||||
• |gx| in help buffers opens the online documentation for the tag at 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.
|
||||
• |:Undotree| for visually navigating the |undo-tree|
|
||||
• |:wall| permits a |++p| option for creating parent directories when writing
|
||||
changed buffers.
|
||||
• The |:DiffTool| command compares directories (and files).
|
||||
(Or use `:{range}lua` to skip the detection.)
|
||||
• |:wall| with |++p| auto-creates missing parent directories.
|
||||
|
||||
EVENTS
|
||||
|
||||
• A new `empty` message kind is emitted for an empty (e.g. `:echo ""`) message.
|
||||
• In the |ui-protocol|, message kind `empty` is emitted for empty messages
|
||||
(e.g. `:echo ""`).
|
||||
• |CmdlineLeave| sets |v:char| to the character that stops the Cmdline mode.
|
||||
• |CmdlineLeavePre| triggered before preparing to leave the command line.
|
||||
• New `append`, `id` and `trigger` parameter for |ui-messages| `msg_show` event.
|
||||
@@ -263,7 +197,7 @@ EVENTS
|
||||
support implicit marks like |'[| or |'<|, …).
|
||||
• |SessionLoadPre| is triggered before loading a |Session| file.
|
||||
• |TabClosedPre| is triggered before closing a |tabpage|.
|
||||
• New `terminator` parameter for |TermRequest| event.
|
||||
• |TermRequest| event gained a `terminator` parameter.
|
||||
|
||||
HIGHLIGHTS
|
||||
|
||||
@@ -276,13 +210,41 @@ HIGHLIGHTS
|
||||
|
||||
LSP
|
||||
|
||||
• |lsp-completion|:
|
||||
• |vim.lsp.completion.enable()| gained a `cmp` option for custom ordering.
|
||||
• Supports colored symbol preview for color items.
|
||||
• Shows a preview ("completionItem/resolve") if 'completeopt' has "popup".
|
||||
• Support for `textDocument/inlineCompletion` |lsp-inline_completion|
|
||||
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_inlineCompletion
|
||||
See |lsp-inline_completion| for quickstart instructions.
|
||||
• |:lsp| can be used to interactively manage LSP clients.
|
||||
• |vim.lsp.ClientConfig| gained `workspace_required`.
|
||||
• You can control the priority of |vim.lsp.Config| `root_markers`.
|
||||
• Support for `textDocument/documentColor`: |lsp-document_color|
|
||||
https://microsoft.github.io/language-server-protocol/specification/#textDocument_documentColor
|
||||
• Support for `textDocument/colorPresentation |lsp-document_color|
|
||||
https://microsoft.github.io/language-server-protocol/specification/#textDocument_colorPresentation
|
||||
• LSP capabilities:
|
||||
• `textDocument/codeLens` |lsp-codelens| was reimplemented.
|
||||
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_codeLens
|
||||
• `textDocument/colorPresentation` |lsp-document_color|
|
||||
https://microsoft.github.io/language-server-protocol/specification/#textDocument_colorPresentation
|
||||
• `textDocument/diagnostic`
|
||||
• `textDocument/documentColor` |lsp-document_color|
|
||||
https://microsoft.github.io/language-server-protocol/specification/#textDocument_documentColor
|
||||
• `textDocument/documentLink`: |gx| opens "documentLink" items at cursor.
|
||||
• `textDocument/inlineCompletion`
|
||||
• `textDocument/linkedEditingRange` |lsp-linked_editing_range|
|
||||
https://microsoft.github.io/language-server-protocol/specification/#textDocument_linkedEditingRange
|
||||
• `textDocument/onTypeFormatting` |lsp-on_type_formatting|
|
||||
https://microsoft.github.io/language-server-protocol/specification/#textDocument_onTypeFormatting
|
||||
• `textDocument/selectionRange` Incremental selection.
|
||||
|v_an| selects outwards, |v_in| selects inwards.
|
||||
• `textDocument/semanticTokens/range`
|
||||
• `workspace/codeLens/refresh`
|
||||
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeLens_refresh
|
||||
• `workspace/diagnostic/refresh`
|
||||
https://microsoft.github.io/language-server-protocol/specification/#diagnostic_refresh
|
||||
• `workspace/diagnostic` |vim.lsp.buf.workspace_diagnostics()|
|
||||
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_dagnostics
|
||||
• Support for dynamic registration:
|
||||
• `textDocument/diagnostic`
|
||||
• The `textDocument/diagnostic` request now includes the previous id in its
|
||||
parameters.
|
||||
• |vim.lsp.enable()| start/stops clients as necessary and detaches
|
||||
@@ -290,10 +252,6 @@ LSP
|
||||
• |vim.lsp.is_enabled()| checks if a LSP config is enabled (without
|
||||
"resolving" it).
|
||||
• |vim.lsp.get_configs()| gets all LSP configs matching an optional filter.
|
||||
• Support for `workspace/diagnostic`: |vim.lsp.buf.workspace_diagnostics()|
|
||||
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_dagnostics
|
||||
• 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
|
||||
@@ -306,16 +264,9 @@ LSP
|
||||
• 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.
|
||||
• Support for `textDocument/linkedEditingRange`: |lsp-linked_editing_range|
|
||||
https://microsoft.github.io/language-server-protocol/specification/#textDocument_linkedEditingRange
|
||||
• Support for related documents in pull diagnostics:
|
||||
https://microsoft.github.io/language-server-protocol/specifications/specification-current/#relatedFullDocumentDiagnosticReport
|
||||
• |vim.lsp.buf.signature_help()| supports "noActiveParameterSupport".
|
||||
• Support for `textDocument/inlineCompletion` |lsp-inline_completion|
|
||||
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_inlineCompletion
|
||||
See |lsp-inline_completion| for quickstart instructions.
|
||||
• Support for `textDocument/onTypeFormatting`: |lsp-on_type_formatting|
|
||||
https://microsoft.github.io/language-server-protocol/specification/#textDocument_onTypeFormatting
|
||||
• The filter option of |vim.lsp.buf.code_action()| now receives the client ID as an argument.
|
||||
• |vim.lsp.ClientConfig| `exit_timeout` decides the time waited before "stop"
|
||||
escalates to "force-stop" for |vim.lsp.enable()|, |Client:stop()|, and
|
||||
@@ -324,45 +275,30 @@ LSP
|
||||
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.
|
||||
• |lsp-completion|:
|
||||
• |vim.lsp.completion.enable()| gained a `cmp` option for custom ordering.
|
||||
• Supports colored symbol preview for color items.
|
||||
• Shows a preview ("completionItem/resolve") if 'completeopt' has "popup".
|
||||
• Support for `workspace/diagnostic/refresh`:
|
||||
https://microsoft.github.io/language-server-protocol/specification/#diagnostic_refresh
|
||||
• Support for dynamic registration for `textDocument/diagnostic`
|
||||
• |vim.lsp.buf.rename()| now highlights the symbol being renamed using the
|
||||
|hl-LspReferenceTarget| highlight group.
|
||||
• Support for `textDocument/semanticTokens/range`.
|
||||
• Support for `textDocument/codeLens` |lsp-codelens| has been reimplemented:
|
||||
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_codeLens
|
||||
• Code lenses now display as virtual lines
|
||||
• Support for `workspace/codeLens/refresh`:
|
||||
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeLens_refresh
|
||||
• |gx| opens `textDocument/documentLink` items found at cursor.
|
||||
|
||||
LUA
|
||||
|
||||
• |vim.net.request()| can fetch files via HTTP GET requests.
|
||||
• |vim.net.request()| can fetch/download HTTP content.
|
||||
• |vim.wait()| returns the callback results.
|
||||
• Lua type annotations for `vim.uv`.
|
||||
• |vim.hl.range()| now allows multiple timed highlights.
|
||||
• |vim.tbl_extend()| and |vim.tbl_deep_extend()| now accept a function behavior argument.
|
||||
• |vim.tbl_extend()|, |vim.tbl_deep_extend()| `behavior` argument can be a function.
|
||||
• |vim.fs.root()| can define "equal priority" via nested lists.
|
||||
• |vim.version.range()| output can be converted to a human-readable string with |tostring()|.
|
||||
• |vim.fs.ext()| returns the last extension of a file.
|
||||
• |vim.version.range()| can output human-readable string via |tostring()|.
|
||||
• |vim.version.intersect()| computes intersection of two version ranges.
|
||||
• |Iter:take()| and |Iter:skip()| now optionally accept predicates.
|
||||
• |Iter:peek()| now works for all iterator types, not just |list-iterator|.
|
||||
• Built-in plugin manager |vim.pack|
|
||||
• |vim.list.unique()| and |Iter:unique()| to deduplicate lists and iterators,
|
||||
respectively.
|
||||
• |vim.list.bisect()| for binary search.
|
||||
• Experimental `vim.pos` and `vim.range` for Position/Range abstraction.
|
||||
• |vim.json.encode()| has an `indent` option for pretty-formatting.
|
||||
• |vim.json.encode()| has an `sort_keys` option.
|
||||
• |Range:is_empty()| to check if a |vim.Range| is empty.
|
||||
• |vim.json.decode()| has an `skip_comments` option.
|
||||
• |vim.fs.ext()| returns the last extension of a file.
|
||||
• |vim.list.bisect()| performs binary search.
|
||||
• |vim.json.encode()| `indent` option performs pretty-formatting.
|
||||
• |vim.json.encode()| `sort_keys` option sorts by key.
|
||||
• |vim.json.decode()| `skip_comments` option allows comments in JSON data.
|
||||
• EXPERIMENTAL: |vim.pos|, |vim.range| provide Position/Range abstraction.
|
||||
|
||||
OPTIONS
|
||||
|
||||
@@ -386,14 +322,14 @@ OPTIONS
|
||||
• 'maxsearchcount' sets maximum value for |searchcount()| and defaults to 999.
|
||||
• 'pummaxwidth' sets maximum width for the completion popup menu.
|
||||
• 'winborder' "bold" style, custom border style.
|
||||
• |g:clipboard| accepts a string name to force any builtin clipboard tool.
|
||||
• 'busy' sets a buffer "busy" status. Indicated in the default statusline.
|
||||
• 'pumborder' adds a border to the popup menu.
|
||||
• |g:clipboard| autodetection only selects tmux when running inside tmux.
|
||||
• |g:clipboard| accepts a string name to force any builtin clipboard tool.
|
||||
• |g:clipboard| autodetection selects tmux only when running inside tmux.
|
||||
• 'statusline' allows "stacking" highlight groups (groups inherit from
|
||||
previous highlight attributes)
|
||||
• 'messagesopt' added progress:c to control if progress messages are shown in
|
||||
cmdline.
|
||||
• 'messagesopt' "progress:c" flag controls whether progress messages are shown
|
||||
in the cmdline message area.
|
||||
• Improved |:set+=|, |:set^=| and |:set-=| handling of comma-separated "key:value"
|
||||
pairs (e.g. 'listchars', 'fillchars', 'diffopt').
|
||||
|
||||
@@ -414,6 +350,9 @@ PERFORMANCE
|
||||
|
||||
PLUGINS
|
||||
|
||||
• Built-in plugin manager: |vim.pack|
|
||||
• |:DiffTool| compares directories (and files).
|
||||
• |:Undotree| lets you visually navigate the |undo-tree|.
|
||||
• Customize :checkhealth by handling a `FileType checkhealth` event.
|
||||
|health-usage|
|
||||
• Simplify Python provider setup to a single step: `uv tool install pynvim`
|
||||
|
||||
@@ -75,6 +75,7 @@ Defaults *defaults* *nvim-defaults*
|
||||
- 'nrformats' defaults to "bin,hex"
|
||||
- 'path' defaults to ".,,". The C ftplugin adds "/usr/include" if it exists.
|
||||
- 'sessionoptions' includes "unix,slash", excludes "options"
|
||||
- 'shelltemp' is disabled
|
||||
- 'shortmess' includes "CF", excludes "S"
|
||||
- 'sidescroll' defaults to 1
|
||||
- 'smarttab' is enabled
|
||||
|
||||
@@ -117,7 +117,7 @@ append({lnum}, {text}) *append()*
|
||||
(`0|1`)
|
||||
|
||||
appendbufline({buf}, {lnum}, {text}) *appendbufline()*
|
||||
Like |append()| but append the text in buffer {expr}.
|
||||
Like |append()| but append the text in buffer {buf}.
|
||||
|
||||
This function works only for loaded buffers. First call
|
||||
|bufload()| if needed.
|
||||
|
||||
@@ -760,12 +760,14 @@ v:versionlong
|
||||
*v:vim_did_enter* *vim_did_enter-variable*
|
||||
v:vim_did_enter
|
||||
0 during startup, 1 just before |VimEnter|.
|
||||
See also |v:vim_did_init|, which is set earlier.
|
||||
Read-only.
|
||||
|
||||
*v:vim_did_init* *vim_did_init-variable*
|
||||
v:vim_did_init
|
||||
0 during initialization, 1 after sourcing |vimrc| and just
|
||||
before |load-plugins|.
|
||||
0 during initialization, 1 after sourcing the user |vimrc|,
|
||||
just before |load-plugins|.
|
||||
See also |v:vim_did_enter|, which is set later.
|
||||
Read-only.
|
||||
|
||||
*v:virtnum* *virtnum-variable*
|
||||
|
||||
@@ -713,8 +713,7 @@ function vim.tbl_add_reverse_lookup(o)
|
||||
return o
|
||||
end
|
||||
|
||||
--- Index into a table (first argument) via string keys passed as subsequent arguments.
|
||||
--- Return `nil` if the key does not exist.
|
||||
--- Gets a value from (nested) table `o` given by the sequence of keys `...`, or `nil` if not found.
|
||||
---
|
||||
--- Examples:
|
||||
---
|
||||
@@ -1223,7 +1222,7 @@ do
|
||||
--- `'thread'`, `'userdata'`.
|
||||
--- - (`fun(val:any): boolean, string?`) A function that returns a boolean and an optional
|
||||
--- string message.
|
||||
--- @param optional? boolean Argument is optional (may be omitted)
|
||||
--- @param optional? boolean Parameter is optional (may be omitted or nil)
|
||||
--- @param message? string message when validation fails
|
||||
--- @overload fun(name: string, val: any, validator: vim.validate.Validator, message: string)
|
||||
--- @overload fun(spec: table<string,[any, vim.validate.Validator, boolean|string]>)
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
--- Unlike the legacy |hit-enter| prompt, messages exceeding 'cmdheight' are
|
||||
--- instead "collapsed", followed by a `[+x]` "spill" indicator, where `x`
|
||||
--- indicates the spilled lines. To see the full messages, do either:
|
||||
--- - ENTER while cmdline is expanded (not in |Insert-mode| and |Terminal-mode|).
|
||||
--- - ENTER immediately after interactive |:| cmdline shows a message and returns to |Normal-mode|.
|
||||
--- - |g<| at any time.
|
||||
|
||||
local api = vim.api
|
||||
|
||||
2
runtime/lua/vim/_meta/api.lua
generated
2
runtime/lua/vim/_meta/api.lua
generated
@@ -2238,6 +2238,7 @@ function vim.api.nvim_set_decoration_provider(ns_id, opts) end
|
||||
--- - force: if true force update the highlight group when it exists.
|
||||
--- - link: Name of highlight group to link to. `:hi-link`
|
||||
--- - sp: color name or "#RRGGBB"
|
||||
--- - update: boolean (default false) Update specified attributes only, leave others unchanged.
|
||||
--- - altfont: boolean
|
||||
--- - blink: boolean
|
||||
--- - bold: boolean
|
||||
@@ -2254,7 +2255,6 @@ function vim.api.nvim_set_decoration_provider(ns_id, opts) end
|
||||
--- - underdotted: boolean
|
||||
--- - underdouble: boolean
|
||||
--- - underline: boolean
|
||||
--- - update: boolean false by default; true updates only specified attributes, leaving others unchanged.
|
||||
function vim.api.nvim_set_hl(ns_id, name, val) end
|
||||
|
||||
--- Set active namespace for highlights defined with `nvim_set_hl()`. This can be set for
|
||||
|
||||
@@ -25,8 +25,8 @@ vim.json = {}
|
||||
--- (default: `false`)
|
||||
--- @field escape_slash? boolean
|
||||
---
|
||||
--- If non-empty, the returned JSON is formatted with newlines and whitespace, where `indent`
|
||||
--- defines the whitespace at each nesting level.
|
||||
--- If non-empty, each value in a JSON object or array starts on a new line and is prefixed with
|
||||
--- `indent` per nesting level. Adds a space after colons. Does not add a final newline.
|
||||
--- (default: `""`)
|
||||
--- @field indent? string
|
||||
---
|
||||
|
||||
2
runtime/lua/vim/_meta/vimfn.lua
generated
2
runtime/lua/vim/_meta/vimfn.lua
generated
@@ -90,7 +90,7 @@ function vim.fn.api_info() end
|
||||
--- @return 0|1
|
||||
function vim.fn.append(lnum, text) end
|
||||
|
||||
--- Like |append()| but append the text in buffer {expr}.
|
||||
--- Like |append()| but append the text in buffer {buf}.
|
||||
---
|
||||
--- This function works only for loaded buffers. First call
|
||||
--- |bufload()| if needed.
|
||||
|
||||
6
runtime/lua/vim/_meta/vvars.lua
generated
6
runtime/lua/vim/_meta/vvars.lua
generated
@@ -806,12 +806,14 @@ vim.v.version = ...
|
||||
vim.v.versionlong = ...
|
||||
|
||||
--- 0 during startup, 1 just before `VimEnter`.
|
||||
--- See also `v:vim_did_init`, which is set earlier.
|
||||
--- Read-only.
|
||||
--- @type integer
|
||||
vim.v.vim_did_enter = ...
|
||||
|
||||
--- 0 during initialization, 1 after sourcing `vimrc` and just
|
||||
--- before `load-plugins`.
|
||||
--- 0 during initialization, 1 after sourcing the user `vimrc`,
|
||||
--- just before `load-plugins`.
|
||||
--- See also `v:vim_did_enter`, which is set later.
|
||||
--- Read-only.
|
||||
--- @type integer
|
||||
vim.v.vim_did_init = ...
|
||||
|
||||
@@ -1,4 +1,13 @@
|
||||
--- @brief <pre>help
|
||||
--- *vim.fs.copy()*
|
||||
--- Use |filecopy()| or |uv.fs_copyfile()| to performantly copy an existing file.
|
||||
---
|
||||
--- Example:
|
||||
---
|
||||
--- >lua
|
||||
--- vim.fn.filecopy('foo.txt', 'bar.txt')
|
||||
--- <
|
||||
---
|
||||
--- *vim.fs.exists()*
|
||||
--- Use |uv.fs_stat()| to check a file's type, and whether it exists.
|
||||
---
|
||||
|
||||
@@ -23,16 +23,13 @@ local M = {}
|
||||
---
|
||||
--- ```lua
|
||||
--- vim.ui.select({ 'tabs', 'spaces' }, {
|
||||
--- prompt = 'Select tabs or spaces:',
|
||||
--- format_item = function(item)
|
||||
--- return "I'd like to choose " .. item
|
||||
--- end,
|
||||
--- prompt = 'Select tabs or spaces:',
|
||||
--- format_item = function(item)
|
||||
--- return ('I choose %s!'):format(item)
|
||||
--- end,
|
||||
--- }, function(choice)
|
||||
--- if choice == 'spaces' then
|
||||
--- vim.o.expandtab = true
|
||||
--- else
|
||||
--- vim.o.expandtab = false
|
||||
--- end
|
||||
--- vim.o.expandtab = choice == 'spaces'
|
||||
--- vim.print(('Selected "%s" => expandtab=%s'):format(choice, vim.o.expandtab))
|
||||
--- end)
|
||||
--- ```
|
||||
---
|
||||
|
||||
@@ -154,6 +154,7 @@ DictAs(get_hl_info) nvim_get_hl(Integer ns_id, Dict(get_highlight) *opts, Arena
|
||||
/// - force: if true force update the highlight group when it exists.
|
||||
/// - link: Name of highlight group to link to. |:hi-link|
|
||||
/// - sp: color name or "#RRGGBB"
|
||||
/// - update: boolean (default false) Update specified attributes only, leave others unchanged.
|
||||
/// - altfont: boolean
|
||||
/// - blink: boolean
|
||||
/// - bold: boolean
|
||||
@@ -170,7 +171,6 @@ DictAs(get_hl_info) nvim_get_hl(Integer ns_id, Dict(get_highlight) *opts, Arena
|
||||
/// - underdotted: boolean
|
||||
/// - underdouble: boolean
|
||||
/// - underline: boolean
|
||||
/// - update: boolean false by default; true updates only specified attributes, leaving others unchanged.
|
||||
/// @param[out] err Error details, if any
|
||||
void nvim_set_hl(uint64_t channel_id, Integer ns_id, String name, Dict(highlight) *val, Error *err)
|
||||
FUNC_API_SINCE(7)
|
||||
@@ -1591,7 +1591,7 @@ ArrayOf(DictAs(get_keymap)) nvim_get_keymap(String mode, Arena *arena)
|
||||
/// nmap <nowait> <Space><NL> <Nop>
|
||||
/// ```
|
||||
///
|
||||
/// @param channel_id
|
||||
/// @param channel_id Channel id (implicit dispatcher arg)
|
||||
/// @param mode Mode short-name (map command prefix: "n", "i", "v", "x", …)
|
||||
/// or "!" for |:map!|, or empty string for |:map|.
|
||||
/// "ia", "ca" or "!a" for abbreviation in Insert mode, Cmdline mode, or both, respectively
|
||||
@@ -1650,7 +1650,7 @@ ArrayOf(Object, 2) nvim_get_api_info(uint64_t channel_id, Arena *arena)
|
||||
/// Can be called more than once; caller should merge old info if appropriate. Example: a library
|
||||
/// first identifies the channel, then a plugin using that library later identifies itself.
|
||||
///
|
||||
/// @param channel_id
|
||||
/// @param channel_id Channel id (implicit dispatcher arg)
|
||||
/// @param name Client short-name. Sets the `client.name` field of |nvim_get_chan_info()|.
|
||||
/// @param version Dict describing the version, with these
|
||||
/// (optional) keys:
|
||||
|
||||
@@ -161,7 +161,7 @@ M.funcs = {
|
||||
args = 3,
|
||||
base = 3,
|
||||
desc = [=[
|
||||
Like |append()| but append the text in buffer {expr}.
|
||||
Like |append()| but append the text in buffer {buf}.
|
||||
|
||||
This function works only for loaded buffers. First call
|
||||
|bufload()| if needed.
|
||||
|
||||
@@ -1016,7 +1016,7 @@ static void nlua_print_event(void **argv)
|
||||
msg_multihl(NIL, msg, "lua_print", true, false, NULL, &needs_clear);
|
||||
}
|
||||
|
||||
/// Print as a Vim message
|
||||
/// Implements Lua print() as a Nvim message.
|
||||
///
|
||||
/// @param lstate Lua interpreter state.
|
||||
static int nlua_print(lua_State *const lstate)
|
||||
|
||||
@@ -916,14 +916,16 @@ M.vars = {
|
||||
type = 'integer',
|
||||
desc = [=[
|
||||
0 during startup, 1 just before |VimEnter|.
|
||||
See also |v:vim_did_init|, which is set earlier.
|
||||
Read-only.
|
||||
]=],
|
||||
},
|
||||
vim_did_init = {
|
||||
type = 'integer',
|
||||
desc = [=[
|
||||
0 during initialization, 1 after sourcing |vimrc| and just
|
||||
before |load-plugins|.
|
||||
0 during initialization, 1 after sourcing the user |vimrc|,
|
||||
just before |load-plugins|.
|
||||
See also |v:vim_did_enter|, which is set later.
|
||||
Read-only.
|
||||
]=],
|
||||
},
|
||||
|
||||
@@ -262,14 +262,14 @@ describe('API: set highlight', function()
|
||||
api.nvim_set_hl(0, 'TestGroup', { fg = '#ff0000', bg = '#0000ff', bold = true })
|
||||
api.nvim_set_hl(0, 'TestGroup', { bg = '#00ff00', update = true })
|
||||
local hl = api.nvim_get_hl(0, { name = 'TestGroup' })
|
||||
eq(16711680, hl.fg)
|
||||
eq(65280, hl.bg)
|
||||
eq(tonumber('0xff0000'), hl.fg)
|
||||
eq(tonumber('0x00ff00'), hl.bg)
|
||||
eq(true, hl.bold)
|
||||
|
||||
api.nvim_set_hl(0, 'TestGroup', { bold = false, update = true })
|
||||
hl = api.nvim_get_hl(0, { name = 'TestGroup' })
|
||||
eq(nil, hl.bold)
|
||||
eq(16711680, hl.fg)
|
||||
eq(tonumber('0xff0000'), hl.fg)
|
||||
|
||||
api.nvim_set_hl(0, 'TestGroup', { italic = true })
|
||||
|
||||
@@ -282,7 +282,7 @@ describe('API: set highlight', function()
|
||||
api.nvim_set_hl(ns, 'TestGroup', { fg = '#ff0000', italic = true })
|
||||
api.nvim_set_hl(ns, 'TestGroup', { fg = '#00ff00', update = true })
|
||||
hl = api.nvim_get_hl(ns, { name = 'TestGroup' })
|
||||
eq(65280, hl.fg)
|
||||
eq(tonumber('0x00ff00'), hl.fg)
|
||||
eq(true, hl.italic)
|
||||
|
||||
api.nvim_set_hl(0, 'LinkedGroup', { link = 'Normal' })
|
||||
|
||||
@@ -1701,7 +1701,7 @@ describe('cmdheight=0', function()
|
||||
]])
|
||||
end)
|
||||
|
||||
it('no spurious newline before first message in headless mode', function()
|
||||
it('no spurious newline before first message with --headless mode', function()
|
||||
local p = n.spawn_wait({
|
||||
args = { '--cmd', 'set cmdheight=0', '-c', 'echo 1', '+q' },
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user