aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/autoload/provider/clipboard.vim6
-rw-r--r--runtime/autoload/provider/node.vim4
-rw-r--r--runtime/autoload/provider/perl.vim2
-rw-r--r--runtime/autoload/provider/python3.vim2
-rw-r--r--runtime/autoload/provider/ruby.vim2
-rw-r--r--runtime/colors/vim.lua1
-rw-r--r--runtime/doc/api.txt49
-rw-r--r--runtime/doc/diff.txt30
-rw-r--r--runtime/doc/faq.txt8
-rw-r--r--runtime/doc/insert.txt9
-rw-r--r--runtime/doc/lsp.txt374
-rw-r--r--runtime/doc/lua.txt71
-rw-r--r--runtime/doc/news-0.10.txt2
-rw-r--r--runtime/doc/news-0.11.txt5
-rw-r--r--runtime/doc/news.txt7
-rw-r--r--runtime/doc/options.txt25
-rw-r--r--runtime/doc/pattern.txt6
-rw-r--r--runtime/doc/provider.txt4
-rw-r--r--runtime/doc/syntax.txt11
-rw-r--r--runtime/doc/vi_diff.txt5
-rw-r--r--runtime/doc/vim_diff.txt2
-rw-r--r--runtime/lua/vim/_defaults.lua4
-rw-r--r--runtime/lua/vim/_meta/api.lua55
-rw-r--r--runtime/lua/vim/_meta/options.lua28
-rw-r--r--runtime/lua/vim/health.lua18
-rw-r--r--runtime/lua/vim/lsp.lua136
-rw-r--r--runtime/lua/vim/lsp/client.lua3
-rw-r--r--runtime/lua/vim/lsp/health.lua42
-rw-r--r--runtime/lua/vim/lsp/inlay_hint.lua4
-rw-r--r--runtime/lua/vim/provider/health.lua29
-rw-r--r--runtime/lua/vim/provider/python.lua2
-rw-r--r--runtime/lua/vim/treesitter/_headings.lua8
-rw-r--r--runtime/lua/vim/treesitter/_meta/misc.lua4
-rw-r--r--runtime/lua/vim/treesitter/languagetree.lua123
-rw-r--r--runtime/nvim.desktop2
-rw-r--r--runtime/optwin.vim4
-rw-r--r--runtime/syntax/hyprlang.vim7
-rw-r--r--runtime/syntax/java.vim24
-rw-r--r--runtime/syntax/lf.vim194
-rw-r--r--runtime/syntax/solidity.vim14
-rw-r--r--runtime/syntax/vim.vim2
41 files changed, 740 insertions, 588 deletions
diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim
index abbd41d62a..7e7feb50e0 100644
--- a/runtime/autoload/provider/clipboard.vim
+++ b/runtime/autoload/provider/clipboard.vim
@@ -5,11 +5,11 @@
if exists('g:loaded_clipboard_provider')
finish
endif
-" Default to 1. provider#clipboard#Executable() may set 2.
+" Default to 0. provider#clipboard#Executable() may set 2.
" To force a reload:
" :unlet g:loaded_clipboard_provider
" :runtime autoload/provider/clipboard.vim
-let g:loaded_clipboard_provider = 1
+let g:loaded_clipboard_provider = 0
let s:copy = {}
let s:paste = {}
@@ -284,4 +284,4 @@ function! provider#clipboard#Call(method, args) abort
endfunction
" eval_has_provider() decides based on this variable.
-let g:loaded_clipboard_provider = empty(provider#clipboard#Executable()) ? 1 : 2
+let g:loaded_clipboard_provider = empty(provider#clipboard#Executable()) ? 0 : 2
diff --git a/runtime/autoload/provider/node.vim b/runtime/autoload/provider/node.vim
index 3e7b8b4ef9..7cd5cab864 100644
--- a/runtime/autoload/provider/node.vim
+++ b/runtime/autoload/provider/node.vim
@@ -1,7 +1,7 @@
if exists('g:loaded_node_provider')
finish
endif
-let g:loaded_node_provider = 1
+let g:loaded_node_provider = 0
function! s:is_minimum_version(version, min_version) abort
if empty(a:version)
@@ -152,7 +152,7 @@ endfunction
let s:err = ''
let [s:prog, s:_] = provider#node#Detect()
-let g:loaded_node_provider = empty(s:prog) ? 1 : 2
+let g:loaded_node_provider = empty(s:prog) ? 0 : 2
if g:loaded_node_provider != 2
let s:err = 'Cannot find the "neovim" node package. Try :checkhealth'
diff --git a/runtime/autoload/provider/perl.vim b/runtime/autoload/provider/perl.vim
index b439f751ae..5ebcc28aaf 100644
--- a/runtime/autoload/provider/perl.vim
+++ b/runtime/autoload/provider/perl.vim
@@ -11,5 +11,5 @@ function! provider#perl#Require(host) abort
endfunction
let s:prog = v:lua.vim.provider.perl.detect()
-let g:loaded_perl_provider = empty(s:prog) ? 1 : 2
+let g:loaded_perl_provider = empty(s:prog) ? 0 : 2
call v:lua.require'vim.provider.perl'.start()
diff --git a/runtime/autoload/provider/python3.vim b/runtime/autoload/provider/python3.vim
index 43c14122d0..8c8a466e0d 100644
--- a/runtime/autoload/provider/python3.vim
+++ b/runtime/autoload/provider/python3.vim
@@ -11,5 +11,5 @@ function! provider#python3#Require(host) abort
endfunction
let s:prog = v:lua.vim.provider.python.detect_by_module('neovim')
-let g:loaded_python3_provider = empty(s:prog) ? 1 : 2
+let g:loaded_python3_provider = empty(s:prog) ? 0 : 2
call v:lua.require'vim.provider.python'.start()
diff --git a/runtime/autoload/provider/ruby.vim b/runtime/autoload/provider/ruby.vim
index 07b4aca23f..9bcbcfc9dd 100644
--- a/runtime/autoload/provider/ruby.vim
+++ b/runtime/autoload/provider/ruby.vim
@@ -11,6 +11,6 @@ function! provider#ruby#Call(method, args) abort
endfunction
let s:prog = v:lua.vim.provider.ruby.detect()
-let g:loaded_ruby_provider = empty(s:prog) ? 1 : 2
+let g:loaded_ruby_provider = empty(s:prog) ? 0 : 2
let s:plugin_path = expand('<sfile>:p:h') . '/script_host.rb'
call v:lua.require'vim.provider.ruby'.start(s:plugin_path)
diff --git a/runtime/colors/vim.lua b/runtime/colors/vim.lua
index f10cdedee0..1b6ab01671 100644
--- a/runtime/colors/vim.lua
+++ b/runtime/colors/vim.lua
@@ -47,6 +47,7 @@ hi('WildMenu', { fg = 'Black', bg = 'Yellow', ctermfg = 'Black', cterm
hi('VertSplit', { link = 'Normal' })
hi('WinSeparator', { link = 'VertSplit' })
hi('WinBarNC', { link = 'WinBar' })
+hi('DiffTextAdd', { link = 'DiffText' })
hi('EndOfBuffer', { link = 'NonText' })
hi('LineNrAbove', { link = 'LineNr' })
hi('LineNrBelow', { link = 'LineNr' })
diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt
index eba4bc9562..ccfc117040 100644
--- a/runtime/doc/api.txt
+++ b/runtime/doc/api.txt
@@ -3492,40 +3492,39 @@ nvim_open_win({buffer}, {enter}, {config}) *nvim_open_win()*
empty. The end-of-buffer region is hidden by setting
`eob` flag of 'fillchars' to a space char, and clearing
the |hl-EndOfBuffer| region in 'winhighlight'.
- • border: Style of (optional) window border. This can either
- be a string or an array. The string values are the same as
- those described in 'winborder'. If it is an array, it
- should have a length of eight or any divisor of eight. The
- array will specify the eight chars building up the border
- in a clockwise fashion starting with the top-left corner.
- As an example, the double box style could be specified as: >
- [ "╔", "═" ,"╗", "║", "╝", "═", "╚", "║" ].
+ • border: (`string|string[]`) (defaults to 'winborder'
+ option) Window border. The string form accepts the same
+ values as the 'winborder' option. The array form must have
+ a length of eight or any divisor of eight, specifying the
+ chars that form the border in a clockwise fashion starting
+ from the top-left corner. For example, the double-box
+ style can be specified as: >
+ [ "╔", "═" ,"╗", "║", "╝", "═", "╚", "║" ].
<
- If the number of chars are less than eight, they will be
- repeated. Thus an ASCII border could be specified as >
- [ "/", "-", \"\\\\\", "|" ],
+ If fewer than eight chars are given, they will be
+ repeated. An ASCII border could be specified as: >
+ [ "/", "-", \"\\\\\", "|" ],
<
- or all chars the same as >
- [ "x" ].
+ Or one char for all sides: >
+ [ "x" ].
<
- An empty string can be used to turn off a specific border,
- for instance, >
- [ "", "", "", ">", "", "", "", "<" ]
+ Empty string can be used to hide a specific border. This
+ example will show only vertical borders, not horizontal: >
+ [ "", "", "", ">", "", "", "", "<" ]
<
- will only make vertical borders but not horizontal ones.
- By default, `FloatBorder` highlight is used, which links
- to `WinSeparator` when not defined. It could also be
- specified by character: >
- [ ["+", "MyCorner"], ["x", "MyBorder"] ].
+ By default, |hl-FloatBorder| highlight is used, which
+ links to |hl-WinSeparator| when not defined. Each border
+ side can specify an optional highlight: >
+ [ ["+", "MyCorner"], ["x", "MyBorder"] ].
<
- • title: Title (optional) in window border, string or list.
+ • title: (optional) Title in window border, string or list.
List should consist of `[text, highlight]` tuples. If
string, or a tuple lacks a highlight, the default
highlight group is `FloatTitle`.
• title_pos: Title position. Must be set with `title`
option. Value can be one of "left", "center", or "right".
Default is `"left"`.
- • footer: Footer (optional) in window border, string or
+ • footer: (optional) Footer in window border, string or
list. List should consist of `[text, highlight]` tuples.
If string, or a tuple lacks a highlight, the default
highlight group is `FloatFooter`.
@@ -3773,8 +3772,8 @@ nvim_create_autocmd({event}, {opts}) *nvim_create_autocmd()*
• callback (function|string) optional: Lua function (or
Vimscript function name, if string) called when the
event(s) is triggered. Lua callback can return a truthy
- value (not `false` or `nil`) to delete the autocommand.
- Receives one argument, a table with these keys:
+ value (not `false` or `nil`) to delete the autocommand, and
+ receives one argument, a table with these keys:
*event-args*
• id: (number) autocommand id
• event: (string) name of the triggered event
diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt
index c9de54342e..f39a51022a 100644
--- a/runtime/doc/diff.txt
+++ b/runtime/doc/diff.txt
@@ -214,14 +214,28 @@ The diffs are highlighted with these groups:
|hl-DiffAdd| DiffAdd Added (inserted) lines. These lines exist in
this buffer but not in another.
|hl-DiffChange| DiffChange Changed lines.
-|hl-DiffText| DiffText Changed text inside a Changed line. Vim
- finds the first character that is different,
- and the last character that is different
- (searching from the end of the line). The
- text in between is highlighted. This means
- that parts in the middle that are still the
- same are highlighted anyway. The 'diffopt'
- flags "iwhite" and "icase" are used here.
+|hl-DiffText| DiffText Changed text inside a Changed line. Exact
+ behavior depends on the `inline:` setting in
+ 'diffopt'.
+ With `inline:` set to "simple", Vim finds the
+ first character that is different, and the
+ last character that is different (searching
+ from the end of the line). The text in
+ between is highlighted. This means that parts
+ in the middle that are still the same are
+ highlighted anyway. The 'diffopt' flags
+ "iwhite" and "icase" are used here.
+ With `inline:` set to "char" or "word", Vim
+ uses the internal diff library to perform a
+ detailed diff between the changed blocks and
+ highlight the exact difference between the
+ two. Will respect any 'diffopt' flag that
+ affects internal diff.
+ Not used when `inline:` is set to "none".
+|hl-DiffTextAdd| DiffTextAdd Added text inside a Changed line. Similar to
+ DiffText, but used when there is no
+ corresponding text in other buffers. Not used
+ when `inline:` is set to "simple" or "none".
|hl-DiffDelete| DiffDelete Deleted lines. Also called filler lines,
because they don't really exist in this
buffer.
diff --git a/runtime/doc/faq.txt b/runtime/doc/faq.txt
index a9a7b1768e..b41a99a3f8 100644
--- a/runtime/doc/faq.txt
+++ b/runtime/doc/faq.txt
@@ -205,17 +205,11 @@ Other hints:
:CHECKHEALTH REPORTS E5009: INVALID $VIMRUNTIME ~
-This means `health#check()` couldn't load, which suggests that |$VIMRUNTIME|
-or 'runtimepath' is broken.
+This means |$VIMRUNTIME| or 'runtimepath' is broken.
- |$VIMRUNTIME| must point to Nvim's runtime files, not Vim's.
- The |$VIMRUNTIME| directory contents should be readable by the current user.
- Verify that `:echo &runtimepath` contains the $VIMRUNTIME path.
-- Check the output of: >vim
-
- :call health#check()
- :verbose func health#check
-<
NEOVIM CAN'T FIND ITS RUNTIME ~
diff --git a/runtime/doc/insert.txt b/runtime/doc/insert.txt
index 3c8bb0814a..95980faac8 100644
--- a/runtime/doc/insert.txt
+++ b/runtime/doc/insert.txt
@@ -651,10 +651,11 @@ When completion is active you can use CTRL-E to stop it and go back to the
originally typed text. The CTRL-E will not be inserted.
*complete_CTRL-Y*
-When the popup menu is displayed you can use CTRL-Y to stop completion and
-accept the currently selected entry. The CTRL-Y is not inserted. Typing a
-space, Enter, or some other unprintable character will leave completion mode
-and insert that typed character.
+When the popup menu is displayed, CTRL-Y stops completion and accepts the
+currently selected entry. Typing a space, Enter, or some other unprintable
+character will leave completion mode and insert that typed character. If you
+want to use <Enter> to accept a completion item, use this mapping: >vim
+ inoremap <expr> <cr> pumvisible() ? '<c-y>' : '<cr>'
When the popup menu is displayed there are a few more special keys, see
|popupmenu-keys|.
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index 6d232657c9..da7f40325a 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -76,6 +76,7 @@ listed below, if (1) the language server supports the functionality and (2)
the options are empty or were set by the builtin runtime (ftplugin) files. The
options are not restored when the LSP client is stopped or detached.
+BUFFER-LOCAL DEFAULTS
- 'omnifunc' is set to |vim.lsp.omnifunc()|, use |i_CTRL-X_CTRL-O| to trigger
completion.
- 'tagfunc' is set to |vim.lsp.tagfunc()|. This enables features like
@@ -87,8 +88,9 @@ options are not restored when the LSP client is stopped or detached.
- |K| is mapped to |vim.lsp.buf.hover()| unless |'keywordprg'| is customized or
a custom keymap for `K` exists.
+GLOBAL DEFAULTS
*grr* *gra* *grn* *gri* *i_CTRL-S*
-Some keymaps are created unconditionally when Nvim starts:
+These GLOBAL keymaps are created unconditionally when Nvim starts:
- "grn" is mapped in Normal mode to |vim.lsp.buf.rename()|
- "gra" is mapped in Normal and Visual mode to |vim.lsp.buf.code_action()|
- "grr" is mapped in Normal mode to |vim.lsp.buf.references()|
@@ -96,12 +98,11 @@ Some keymaps are created unconditionally when Nvim starts:
- "gO" is mapped in Normal mode to |vim.lsp.buf.document_symbol()|
- CTRL-S is mapped in Insert mode to |vim.lsp.buf.signature_help()|
-If not wanted, these keymaps can be removed at any time using
-|vim.keymap.del()| or |:unmap| (see also |gr-default|).
+You can remove GLOBAL keymaps at any time using |vim.keymap.del()| or
+|:unmap|. See also |gr-default|.
*lsp-defaults-disable*
-To override or delete any of the above defaults, set or unset the options on
-|LspAttach|: >lua
+To remove or override BUFFER-LOCAL defaults, define a |LspAttach| handler: >lua
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(args)
@@ -789,7 +790,10 @@ buf_request_sync({bufnr}, {method}, {params}, {timeout_ms})
Parameters: ~
• {bufnr} (`integer`) Buffer handle, or 0 for current.
• {method} (`string`) LSP method name
- • {params} (`table?`) Parameters to send to the server
+ • {params} (`table|(fun(client: vim.lsp.Client, bufnr: integer): table?)?`)
+ Parameters to send to the server. Can also be passed as
+ a function that returns the params table for cases where
+ parameters are specific to the client.
• {timeout_ms} (`integer?`, default: `1000`) Maximum time in
milliseconds to wait for a result.
@@ -809,61 +813,90 @@ client_is_stopped({client_id}) *vim.lsp.client_is_stopped()*
(`boolean`) stopped true if client is stopped, false otherwise.
commands *vim.lsp.commands*
- Registry for client side commands. This is an extension point for plugins
- to handle custom commands which are not part of the core language server
- protocol specification.
-
- The registry is a table where the key is a unique command name, and the
- value is a function which is called if any LSP action (code action, code
- lenses, ...) triggers the command.
-
- If an LSP response contains a command for which no matching entry is
- available in this registry, the command will be executed via the LSP
- server using `workspace/executeCommand`.
-
- The first argument to the function will be the `Command`: Command title:
- String command: String arguments?: any[]
+ Registry (a table) for client-side handlers, for custom server-commands
+ that are not in the LSP specification.
+
+ If an LSP response contains a command which is not found in
+ `vim.lsp.commands`, the command will be executed via the LSP server using
+ `workspace/executeCommand`.
+
+ Each key in the table is a unique command name, and each value is a
+ function which is called when an LSP action (code action, code lenses,
+ …) triggers the command.
+ • Argument 1 is the `Command`: >
+ Command
+ title: String
+ command: String
+ arguments?: any[]
+<
+ • Argument 2 is the |lsp-handler| `ctx`.
- The second argument is the `ctx` of |lsp-handler|
+ Example: >lua
+ vim.lsp.commands['java.action.generateToStringPrompt'] = function(_, ctx)
+ require("jdtls.async").run(function()
+ local _, result = request(ctx.bufnr, 'java/checkToStringStatus', ctx.params)
+ local fields = ui.pick_many(result.fields, 'Include item in toString?', function(x)
+ return string.format('%s: %s', x.name, x.type)
+ end)
+ local _, edit = request(ctx.bufnr, 'java/generateToString', { context = ctx.params; fields = fields; })
+ vim.lsp.util.apply_workspace_edit(edit, offset_encoding)
+ end)
+ end
+<
config({name}, {cfg}) *vim.lsp.config()*
- Update the configuration for an LSP client.
-
- Use name '*' to set default configuration for all clients.
+ Sets the default configuration for an LSP client (or all clients if the
+ special name "*" is used).
- Can also be table-assigned to redefine the configuration for a client.
+ Can also be accessed by table-indexing (`vim.lsp.config[…]`) to get the
+ resolved config, or redefine the config (instead of "merging" with the
+ config chain).
Examples:
- • Add a root marker for all clients: >lua
- vim.lsp.config('*', {
- root_markers = { '.git' },
- })
+ • Add root markers for ALL clients: >lua
+ vim.lsp.config('*', {
+ root_markers = { '.git', '.hg' },
+ })
<
- • Add additional capabilities to all clients: >lua
- vim.lsp.config('*', {
- capabilities = {
- textDocument = {
- semanticTokens = {
- multilineTokenSupport = true,
- }
- }
+ • Add capabilities to ALL clients: >lua
+ vim.lsp.config('*', {
+ capabilities = {
+ textDocument = {
+ semanticTokens = {
+ multilineTokenSupport = true,
}
- })
+ }
+ }
+ })
<
- • (Re-)define the configuration for clangd: >lua
- vim.lsp.config.clangd = {
- cmd = {
- 'clangd',
- '--clang-tidy',
- '--background-index',
- '--offset-encoding=utf-8',
- },
- root_markers = { '.clangd', 'compile_commands.json' },
- filetypes = { 'c', 'cpp' },
+ • Add root markers and capabilities for "clangd": >lua
+ vim.lsp.config('clangd', {
+ root_markers = { '.clang-format', 'compile_commands.json' },
+ capabilities = {
+ textDocument = {
+ completion = {
+ completionItem = {
+ snippetSupport = true,
+ }
+ }
}
+ }
+ })
+<
+ • (Re-)define the "clangd" configuration (overrides the resolved chain): >lua
+ vim.lsp.config.clangd = {
+ cmd = {
+ 'clangd',
+ '--clang-tidy',
+ '--background-index',
+ '--offset-encoding=utf-8',
+ },
+ root_markers = { '.clangd', 'compile_commands.json' },
+ filetypes = { 'c', 'cpp' },
+ }
<
- • Get configuration for luals: >lua
- local cfg = vim.lsp.config.luals
+ • Get the resolved configuration for "luals": >lua
+ local cfg = vim.lsp.config.luals
<
Parameters: ~
@@ -1235,125 +1268,130 @@ Lua module: vim.lsp.client *lsp-client*
*vim.lsp.ClientConfig*
Fields: ~
- • {cmd} (`string[]|fun(dispatchers: vim.lsp.rpc.Dispatchers): vim.lsp.rpc.PublicClient`)
- command string[] that launches the language
- server (treated as in |jobstart()|, must be
- absolute or on `$PATH`, shell constructs like
- "~" are not expanded), or function that creates
- an RPC client. Function receives a `dispatchers`
- table and returns a table with member functions
- `request`, `notify`, `is_closing` and
- `terminate`. See |vim.lsp.rpc.request()|,
- |vim.lsp.rpc.notify()|. For TCP there is a
- builtin RPC client factory:
- |vim.lsp.rpc.connect()|
- • {cmd_cwd}? (`string`, default: cwd) Directory to launch the
- `cmd` process. Not related to `root_dir`.
- • {cmd_env}? (`table`) Environment flags to pass to the LSP
- on spawn. Must be specified using a table.
- Non-string values are coerced to string.
- Example: >lua
- { PORT = 8080; HOST = "0.0.0.0"; }
+ • {cmd} (`string[]|fun(dispatchers: vim.lsp.rpc.Dispatchers): vim.lsp.rpc.PublicClient`)
+ command string[] that launches the language
+ server (treated as in |jobstart()|, must be
+ absolute or on `$PATH`, shell constructs like
+ "~" are not expanded), or function that creates
+ an RPC client. Function receives a
+ `dispatchers` table and returns a table with
+ member functions `request`, `notify`,
+ `is_closing` and `terminate`. See
+ |vim.lsp.rpc.request()|,
+ |vim.lsp.rpc.notify()|. For TCP there is a
+ builtin RPC client factory:
+ |vim.lsp.rpc.connect()|
+ • {cmd_cwd}? (`string`, default: cwd) Directory to launch
+ the `cmd` process. Not related to `root_dir`.
+ • {cmd_env}? (`table`) Environment flags to pass to the LSP
+ on spawn. Must be specified using a table.
+ Non-string values are coerced to string.
+ Example: >lua
+ { PORT = 8080; HOST = "0.0.0.0"; }
<
- • {detached}? (`boolean`, default: true) Daemonize the server
- process so that it runs in a separate process
- group from Nvim. Nvim will shutdown the process
- on exit, but if Nvim fails to exit cleanly this
- could leave behind orphaned server processes.
- • {workspace_folders}? (`lsp.WorkspaceFolder[]`) List of workspace
- folders passed to the language server. For
- backwards compatibility rootUri and rootPath
- will be derived from the first workspace folder
- in this list. See `workspaceFolders` in the LSP
- spec.
- • {capabilities}? (`lsp.ClientCapabilities`) Map overriding the
- default capabilities defined by
- |vim.lsp.protocol.make_client_capabilities()|,
- passed to the language server on initialization.
- Hint: use make_client_capabilities() and modify
- its result.
- • Note: To send an empty dictionary use
- |vim.empty_dict()|, else it will be encoded as
- an array.
- • {handlers}? (`table<string,function>`) Map of language
- server method names to |lsp-handler|
- • {settings}? (`lsp.LSPObject`) Map with language server
- specific settings. See the {settings} in
- |vim.lsp.Client|.
- • {commands}? (`table<string,fun(command: lsp.Command, ctx: table)>`)
- Table that maps string of clientside commands to
- user-defined functions. Commands passed to
- `start()` take precedence over the global
- command registry. Each key must be a unique
- command name, and the value is a function which
- is called if any LSP action (code action, code
- lenses, ...) triggers the command.
- • {init_options}? (`lsp.LSPObject`) Values to pass in the
- initialization request as
- `initializationOptions`. See `initialize` in the
- LSP spec.
- • {name}? (`string`, default: client-id) Name in log
- messages.
- • {get_language_id}? (`fun(bufnr: integer, filetype: string): string`)
- Language ID as string. Defaults to the buffer
- filetype.
- • {offset_encoding}? (`'utf-8'|'utf-16'|'utf-32'`) Called "position
- encoding" in LSP spec, the encoding that the LSP
- server expects. Client does not verify this is
- correct.
- • {on_error}? (`fun(code: integer, err: string)`) Callback
- invoked when the client operation throws an
- error. `code` is a number describing the error.
- Other arguments may be passed depending on the
- error kind. See `vim.lsp.rpc.client_errors` for
- possible errors. Use
- `vim.lsp.rpc.client_errors[code]` to get
- human-friendly name.
- • {before_init}? (`fun(params: lsp.InitializeParams, config: vim.lsp.ClientConfig)`)
- Callback invoked before the LSP "initialize"
- phase, where `params` contains the parameters
- being sent to the server and `config` is the
- config that was passed to |vim.lsp.start()|. You
- can use this to modify parameters before they
- are sent.
- • {on_init}? (`elem_or_list<fun(client: vim.lsp.Client, init_result: lsp.InitializeResult)>`)
- Callback invoked after LSP "initialize", where
- `result` is a table of `capabilities` and
- anything else the server may send. For example,
- clangd sends `init_result.offsetEncoding` if
- `capabilities.offsetEncoding` was sent to it.
- You can only modify the `client.offset_encoding`
- here before any notifications are sent.
- • {on_exit}? (`elem_or_list<fun(code: integer, signal: integer, client_id: integer)>`)
- Callback invoked on client exit.
- • code: exit code of the process
- • signal: number describing the signal used to
- terminate (if any)
- • client_id: client handle
- • {on_attach}? (`elem_or_list<fun(client: vim.lsp.Client, bufnr: integer)>`)
- Callback invoked when client attaches to a
- buffer.
- • {trace}? (`'off'|'messages'|'verbose'`, default: "off")
- Passed directly to the language server in the
- initialize request. Invalid/empty values will
- • {flags}? (`table`) A table with flags for the client. The
- current (experimental) flags are:
- • {allow_incremental_sync}? (`boolean`, default:
- `true`) Allow using incremental sync for
- buffer edits
- • {debounce_text_changes} (`integer`, default:
- `150`) Debounce `didChange` notifications to
- the server by the given number in
- milliseconds. No debounce occurs if `nil`.
- • {exit_timeout} (`integer|false`, default:
- `false`) Milliseconds to wait for server to
- exit cleanly after sending the "shutdown"
- request before sending kill -15. If set to
- false, nvim exits immediately after sending
- the "shutdown" request to the server.
- • {root_dir}? (`string`) Directory where the LSP server will
- base its workspaceFolders, rootUri, and rootPath
- on initialization.
+ • {detached}? (`boolean`, default: true) Daemonize the server
+ process so that it runs in a separate process
+ group from Nvim. Nvim will shutdown the process
+ on exit, but if Nvim fails to exit cleanly this
+ could leave behind orphaned server processes.
+ • {workspace_folders}? (`lsp.WorkspaceFolder[]`) List of workspace
+ folders passed to the language server. For
+ backwards compatibility rootUri and rootPath
+ will be derived from the first workspace folder
+ in this list. See `workspaceFolders` in the LSP
+ spec.
+ • {workspace_required}? (`boolean`) (default false) Server requires a
+ workspace (no "single file" support).
+ • {capabilities}? (`lsp.ClientCapabilities`) Map overriding the
+ default capabilities defined by
+ |vim.lsp.protocol.make_client_capabilities()|,
+ passed to the language server on
+ initialization. Hint: use
+ make_client_capabilities() and modify its
+ result.
+ • Note: To send an empty dictionary use
+ |vim.empty_dict()|, else it will be encoded
+ as an array.
+ • {handlers}? (`table<string,function>`) Map of language
+ server method names to |lsp-handler|
+ • {settings}? (`lsp.LSPObject`) Map with language server
+ specific settings. See the {settings} in
+ |vim.lsp.Client|.
+ • {commands}? (`table<string,fun(command: lsp.Command, ctx: table)>`)
+ Table that maps string of clientside commands
+ to user-defined functions. Commands passed to
+ `start()` take precedence over the global
+ command registry. Each key must be a unique
+ command name, and the value is a function which
+ is called if any LSP action (code action, code
+ lenses, ...) triggers the command.
+ • {init_options}? (`lsp.LSPObject`) Values to pass in the
+ initialization request as
+ `initializationOptions`. See `initialize` in
+ the LSP spec.
+ • {name}? (`string`, default: client-id) Name in log
+ messages.
+ • {get_language_id}? (`fun(bufnr: integer, filetype: string): string`)
+ Language ID as string. Defaults to the buffer
+ filetype.
+ • {offset_encoding}? (`'utf-8'|'utf-16'|'utf-32'`) Called "position
+ encoding" in LSP spec, the encoding that the
+ LSP server expects. Client does not verify this
+ is correct.
+ • {on_error}? (`fun(code: integer, err: string)`) Callback
+ invoked when the client operation throws an
+ error. `code` is a number describing the error.
+ Other arguments may be passed depending on the
+ error kind. See `vim.lsp.rpc.client_errors` for
+ possible errors. Use
+ `vim.lsp.rpc.client_errors[code]` to get
+ human-friendly name.
+ • {before_init}? (`fun(params: lsp.InitializeParams, config: vim.lsp.ClientConfig)`)
+ Callback invoked before the LSP "initialize"
+ phase, where `params` contains the parameters
+ being sent to the server and `config` is the
+ config that was passed to |vim.lsp.start()|.
+ You can use this to modify parameters before
+ they are sent.
+ • {on_init}? (`elem_or_list<fun(client: vim.lsp.Client, init_result: lsp.InitializeResult)>`)
+ Callback invoked after LSP "initialize", where
+ `result` is a table of `capabilities` and
+ anything else the server may send. For example,
+ clangd sends `init_result.offsetEncoding` if
+ `capabilities.offsetEncoding` was sent to it.
+ You can only modify the
+ `client.offset_encoding` here before any
+ notifications are sent.
+ • {on_exit}? (`elem_or_list<fun(code: integer, signal: integer, client_id: integer)>`)
+ Callback invoked on client exit.
+ • code: exit code of the process
+ • signal: number describing the signal used to
+ terminate (if any)
+ • client_id: client handle
+ • {on_attach}? (`elem_or_list<fun(client: vim.lsp.Client, bufnr: integer)>`)
+ Callback invoked when client attaches to a
+ buffer.
+ • {trace}? (`'off'|'messages'|'verbose'`, default: "off")
+ Passed directly to the language server in the
+ initialize request. Invalid/empty values will
+ • {flags}? (`table`) A table with flags for the client.
+ The current (experimental) flags are:
+ • {allow_incremental_sync}? (`boolean`,
+ default: `true`) Allow using incremental sync
+ for buffer edits
+ • {debounce_text_changes} (`integer`, default:
+ `150`) Debounce `didChange` notifications to
+ the server by the given number in
+ milliseconds. No debounce occurs if `nil`.
+ • {exit_timeout} (`integer|false`, default:
+ `false`) Milliseconds to wait for server to
+ exit cleanly after sending the "shutdown"
+ request before sending kill -15. If set to
+ false, nvim exits immediately after sending
+ the "shutdown" request to the server.
+ • {root_dir}? (`string`) Directory where the LSP server will
+ base its workspaceFolders, rootUri, and
+ rootPath on initialization.
Client:cancel_request({id}) *Client:cancel_request()*
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index ceb8184eef..be118cf790 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -188,15 +188,19 @@ Examples: >lua
==============================================================================
IMPORTING LUA MODULES *lua-module-load*
-Modules are searched for under the directories specified in 'runtimepath', in
-the order they appear. Any "." in the module name is treated as a directory
-separator when searching. For a module `foo.bar`, each directory is searched
-for `lua/foo/bar.lua`, then `lua/foo/bar/init.lua`. If no files are found,
-the directories are searched again for a shared library with a name matching
-`lua/foo/bar.?`, where `?` is a list of suffixes (such as `so` or `dll`) derived from
-the initial value of |package.cpath|. If still no files are found, Nvim falls
-back to Lua's default search mechanism. The first script found is run and
-`require()` returns the value returned by the script if any, else `true`.
+Modules are searched for under the directories specified in 'runtimepath' and
+|packages-runtimepath|, in the order they appear in the output of this command
+>vim
+ :echo nvim_list_runtime_paths()
+<
+Any "." in the module name is treated as a directory separator when searching.
+For a module `foo.bar`, each directory is searched for `lua/foo/bar.lua`, then
+`lua/foo/bar/init.lua`. If no files are found, the directories are searched
+again for a shared library with a name matching `lua/foo/bar.?`, where `?` is
+a list of suffixes (such as `so` or `dll`) derived from the initial value of
+|package.cpath|. If still no files are found, Nvim falls back to Lua's default
+search mechanism. The first script found is run and `require()` returns the
+value returned by the script if any, else `true`.
The return value is cached after the first call to `require()` for each module,
with subsequent calls returning the cached value without searching for, or
@@ -214,56 +218,9 @@ and loads the first module found ("first wins"): >
bar/lua/mod.so
bar/lua/mod.dll
<
- *lua-package-path*
-Nvim automatically adjusts |package.path| and |package.cpath| according to the
-effective 'runtimepath' value. Adjustment happens whenever 'runtimepath' is
-changed. `package.path` is adjusted by simply appending `/lua/?.lua` and
-`/lua/?/init.lua` to each directory from 'runtimepath' (`/` is actually the
-first character of `package.config`).
-
-Similarly to |package.path|, modified directories from 'runtimepath' are also
-added to |package.cpath|. In this case, instead of appending `/lua/?.lua` and
-`/lua/?/init.lua` to each runtimepath, all unique `?`-containing suffixes of
-the existing |package.cpath| are used. Example:
-
-- 1. Given that
- - 'runtimepath' contains `/foo/bar,/xxx;yyy/baz,/abc`;
- - initial |package.cpath| (defined at compile-time or derived from
- `$LUA_CPATH` / `$LUA_INIT`) contains `./?.so;/def/ghi/a?d/j/g.elf;/def/?.so`.
-- 2. It finds `?`-containing suffixes `/?.so`, `/a?d/j/g.elf` and `/?.so`, in
- order: parts of the path starting from the first path component containing
- question mark and preceding path separator.
-- 3. The suffix of `/def/?.so`, namely `/?.so` is not unique, as it’s the same
- as the suffix of the first path from |package.path| (i.e. `./?.so`). Which
- leaves `/?.so` and `/a?d/j/g.elf`, in this order.
-- 4. 'runtimepath' has three paths: `/foo/bar`, `/xxx;yyy/baz` and `/abc`. The
- second one contains a semicolon which is a paths separator so it is out,
- leaving only `/foo/bar` and `/abc`, in order.
-- 5. The cartesian product of paths from 4. and suffixes from 3. is taken,
- giving four variants. In each variant a `/lua` path segment is inserted
- between path and suffix, leaving:
- - `/foo/bar/lua/?.so`
- - `/foo/bar/lua/a?d/j/g.elf`
- - `/abc/lua/?.so`
- - `/abc/lua/a?d/j/g.elf`
-- 6. New paths are prepended to the original |package.cpath|.
-
-The result will look like this: >
-
- /foo/bar,/xxx;yyy/baz,/abc ('runtimepath')
- × ./?.so;/def/ghi/a?d/j/g.elf;/def/?.so (package.cpath)
- = /foo/bar/lua/?.so;/foo/bar/lua/a?d/j/g.elf;/abc/lua/?.so;/abc/lua/a?d/j/g.elf;./?.so;/def/ghi/a?d/j/g.elf;/def/?.so
-
Note:
-- To track 'runtimepath' updates, paths added at previous update are
- remembered and removed at the next update, while all paths derived from the
- new 'runtimepath' are prepended as described above. This allows removing
- paths when path is removed from 'runtimepath', adding paths when they are
- added and reordering |package.path|/|package.cpath| content if 'runtimepath'
- was reordered.
-
-- Although adjustments happen automatically, Nvim does not track current
+- Although 'runtimepath' is tracked, Nvim does not track current
values of |package.path| or |package.cpath|. If you happen to delete some
paths from there you can set 'runtimepath' to trigger an update: >vim
let &runtimepath = &runtimepath
diff --git a/runtime/doc/news-0.10.txt b/runtime/doc/news-0.10.txt
index 1399be0d24..7951bbeaaa 100644
--- a/runtime/doc/news-0.10.txt
+++ b/runtime/doc/news-0.10.txt
@@ -213,7 +213,7 @@ The following new features were added.
• By default, the swapfile "ATTENTION" |E325| dialog is skipped if the
swapfile is owned by a running Nvim process, instead of prompting. If you
always want the swapfile dialog, delete the default SwapExists handler:
- `autocmd! nvim_swapfile`. |default-autocmds|
+ `autocmd! nvim.swapfile`. |default-autocmds|
• Navigating the |jumplist| with CTRL+O, CTRL+I behaves more intuitively
when deleting buffers, and avoids "invalid buffer" cases. #25461
• |:fclose| command.
diff --git a/runtime/doc/news-0.11.txt b/runtime/doc/news-0.11.txt
index f934456c3a..36d96b8842 100644
--- a/runtime/doc/news-0.11.txt
+++ b/runtime/doc/news-0.11.txt
@@ -56,6 +56,9 @@ EDITOR
it moves to another help buffer.
• Bells from a |terminal| buffer are now silent by default, unless 'belloff'
option doesn't contain "term" or "all".
+• Renamed autocmd group `nvim_swapfile` to `nvim.swapfile`. |default-autocmds|
+ If you always want the swapfile dialog, delete the `nvim.swapfile` group:
+ `autocmd! nvim.swapfile`.
EVENTS
@@ -288,7 +291,7 @@ LUA
• Command-line completions for: `vim.g`, `vim.t`, `vim.w`, `vim.b`, `vim.v`,
`vim.o`, `vim.wo`, `vim.bo`, `vim.opt`, `vim.opt_local`, `vim.opt_global`,
- and `vim.fn`.
+ `vim.env` and `vim.fn`.
• Documentation for |lua-bit|.
• |gf| in Lua buffers can go to module in same repo, |runtime-search-path| and
|package.path|.
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index ad1481e304..2644bb24b2 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -66,7 +66,7 @@ EVENTS
HIGHLIGHTS
-• todo
+• |hl-DiffTextAdd| highlights added text within a changed line.
LSP
@@ -78,7 +78,8 @@ LUA
OPTIONS
-• todo
+• 'diffopt' `inline:` configures diff highlighting for changes within a line.
+• 'pummaxwidth' sets maximum width for the completion popup menu.
PLUGINS
@@ -123,7 +124,7 @@ EVENTS
LSP
-• todo
+• |vim.lsp.ClientConfig| gained `workspace_required`.
LUA
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index dd2460722e..bdc4f20fac 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -2056,7 +2056,7 @@ A jump table for the options with a short description can be found at |Q_op|.
security reasons.
*'diffopt'* *'dip'*
-'diffopt' 'dip' string (default "internal,filler,closeoff,linematch:40")
+'diffopt' 'dip' string (default "internal,filler,closeoff,inline:simple,linematch:40")
global
Option settings for diff mode. It can consist of the following items.
All are optional. Items must be separated by a comma.
@@ -2119,6 +2119,21 @@ A jump table for the options with a short description can be found at |Q_op|.
Use the indent heuristic for the internal
diff library.
+ inline:{text} Highlight inline differences within a change.
+ See |view-diffs|. Supported values are:
+
+ none Do not perform inline highlighting.
+ simple Highlight from first different
+ character to the last one in each
+ line. This is the default if no
+ `inline:` value is set.
+ char Use internal diff to perform a
+ character-wise diff and highlight the
+ difference.
+ word Use internal diff to perform a
+ |word|-wise diff and highlight the
+ difference.
+
internal Use the internal diff library. This is
ignored when 'diffexpr' is set. *E960*
When running out of memory when writing a
@@ -4608,6 +4623,14 @@ A jump table for the options with a short description can be found at |Q_op|.
Maximum number of items to show in the popup menu
(|ins-completion-menu|). Zero means "use available screen space".
+ *'pummaxwidth'* *'pmw'*
+'pummaxwidth' 'pmw' number (default 0)
+ global
+ Maximum width for the popup menu (|ins-completion-menu|). When zero,
+ there is no maximum width limit, otherwise the popup menu will never be
+ wider than this value. Truncated text will be indicated by "..." at the
+ end. Takes precedence over 'pumwidth'.
+
*'pumwidth'* *'pw'*
'pumwidth' 'pw' number (default 15)
global
diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt
index be913e941e..ec1eb9a4a0 100644
--- a/runtime/doc/pattern.txt
+++ b/runtime/doc/pattern.txt
@@ -1206,7 +1206,8 @@ x A single character, with no special meaning, matches itself
\o40 octal number of character up to 0o377
\x20 hexadecimal number of character up to 0xff
\u20AC hex. number of multibyte character up to 0xffff
- \U1234 hex. number of multibyte character up to 0xffffffff
+ \U1234 hex. number of multibyte character up to 8 characters
+ 0xffffffff |E1541|
NOTE: The other backslash codes mentioned above do not work inside
[]!
- Matching with a collection can be slow, because each character in
@@ -1246,7 +1247,8 @@ x A single character, with no special meaning, matches itself
\%u20AC Matches the character specified with up to four hexadecimal
characters.
\%U1234abcd Matches the character specified with up to eight hexadecimal
- characters, up to 0x7fffffff
+ characters, up to 0x7fffffff (the maximum allowed value is INT_MAX
+ |E1541|, but the maximum valid Unicode codepoint is U+10FFFF).
==============================================================================
7. Ignoring case in a pattern */ignorecase*
diff --git a/runtime/doc/provider.txt b/runtime/doc/provider.txt
index 38bf6281d3..7a4cc0ee7d 100644
--- a/runtime/doc/provider.txt
+++ b/runtime/doc/provider.txt
@@ -11,7 +11,7 @@ the providers and how to install them.
*E319*
Use of a feature requiring a missing provider is an error: >
- E319: No "foo" provider found. Run ":checkhealth provider"
+ E319: No "foo" provider found. Run ":checkhealth vim.provider"
Run the |:checkhealth| command, and review the sections below.
@@ -35,7 +35,7 @@ if you already have it (some package managers install the module with Nvim
itself).
For Python 3 plugins:
-1. Make sure Python 3.4+ is available in your $PATH.
+1. Make sure Python 3.9+ is available in your $PATH.
2. Install the module (try "python" if "python3" is missing): >bash
python3 -m pip install --user --upgrade pynvim
diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt
index faca3d88da..93a385359d 100644
--- a/runtime/doc/syntax.txt
+++ b/runtime/doc/syntax.txt
@@ -1723,12 +1723,12 @@ cycles for such a feature to become either integrated into the platform or
withdrawn from this effort. To cater for early adopters, there is optional
support in Vim for syntax related preview features that are implemented. You
can request it by specifying a list of preview feature numbers as follows: >
- :let g:java_syntax_previews = [455, 476]
+ :let g:java_syntax_previews = [488, 494]
The supported JEP numbers are to be drawn from this table:
`430`: String Templates [JDK 21]
- `455`: Primitive types in Patterns, instanceof, and switch
- `476`: Module Import Declarations
+ `488`: Primitive types in Patterns, instanceof, and switch
+ `494`: Module Import Declarations
Note that as soon as the particular preview feature will have been integrated
into the Java platform, its entry will be removed from the table and related
@@ -5177,8 +5177,11 @@ DiffChange Diff mode: Changed line. |diff.txt|
DiffDelete Diff mode: Deleted line. |diff.txt|
*hl-DiffText*
DiffText Diff mode: Changed text within a changed line. |diff.txt|
+ *hl-DiffTextAdd*
+DiffTextAdd Diff mode: Added text within a changed line. Linked to
+ |hl-DiffText| by default. |diff.txt|
*hl-EndOfBuffer*
-EndOfBuffer Filler lines (~) after the end of the buffer.
+EndOfBuffer Filler lines (~) after the last line in the buffer.
By default, this is highlighted like |hl-NonText|.
*hl-TermCursor*
TermCursor Cursor in a focused terminal.
diff --git a/runtime/doc/vi_diff.txt b/runtime/doc/vi_diff.txt
index 0a0cbc8ec6..c6de169853 100644
--- a/runtime/doc/vi_diff.txt
+++ b/runtime/doc/vi_diff.txt
@@ -31,8 +31,11 @@ Maximum display width Unix and Win32: 1024 characters, otherwise 255
Maximum lhs of a mapping 50 characters.
Number of different highlighting types: over 30000
Range of a Number variable: -2147483648 to 2147483647 (might be more on 64
- bit systems)
+ bit systems) See also: |v:numbermax|,
+ |v:numbermin| and |v:numbersize|
Maximum length of a line in a tags file: 512 bytes.
+ *E1541*
+Maximum value for |/\U| and |/\%U|: 2147483647 (for 32bit integer).
Information for undo and text in registers is kept in memory, thus when making
(big) changes the amount of (virtual) memory available limits the number of
diff --git a/runtime/doc/vim_diff.txt b/runtime/doc/vim_diff.txt
index df79d25198..a5c72363b4 100644
--- a/runtime/doc/vim_diff.txt
+++ b/runtime/doc/vim_diff.txt
@@ -48,7 +48,7 @@ Defaults *defaults* *nvim-defaults*
- 'complete' excludes "i"
- 'completeopt' defaults to "menu,popup"
- 'define' defaults to "". The C ftplugin sets it to "^\\s*#\\s*define"
-- 'diffopt' defaults to "internal,filler,closeoff,linematch:40"
+- 'diffopt' defaults to "internal,filler,closeoff,inline:simple,linematch:40"
- 'directory' defaults to ~/.local/state/nvim/swap// (|xdg|), auto-created
- 'display' defaults to "lastline"
- 'encoding' is UTF-8 (cf. 'fileencoding' for file-content encoding)
diff --git a/runtime/lua/vim/_defaults.lua b/runtime/lua/vim/_defaults.lua
index 7440af1a96..3cb38be450 100644
--- a/runtime/lua/vim/_defaults.lua
+++ b/runtime/lua/vim/_defaults.lua
@@ -622,10 +622,10 @@ do
end
vim.wo[0][0].winhighlight = winhl .. 'StatusLine:StatusLineTerm,StatusLineNC:StatusLineTermNC'
- vim.keymap.set('n', '[[', function()
+ vim.keymap.set({ 'n', 'x' }, '[[', function()
jump_to_prompt(nvim_terminal_prompt_ns, 0, args.buf, -vim.v.count1)
end, { buffer = args.buf, desc = 'Jump [count] shell prompts backward' })
- vim.keymap.set('n', ']]', function()
+ vim.keymap.set({ 'n', 'x' }, ']]', function()
jump_to_prompt(nvim_terminal_prompt_ns, 0, args.buf, vim.v.count1)
end, { buffer = args.buf, desc = 'Jump [count] shell prompts forward' })
end,
diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua
index e7ad91132d..62df0a7707 100644
--- a/runtime/lua/vim/_meta/api.lua
+++ b/runtime/lua/vim/_meta/api.lua
@@ -939,8 +939,8 @@ function vim.api.nvim_create_augroup(name, opts) end
--- - desc (string) optional: description (for documentation and troubleshooting).
--- - callback (function|string) optional: Lua function (or Vimscript function name, if
--- string) called when the event(s) is triggered. Lua callback can return a truthy
---- value (not `false` or `nil`) to delete the autocommand. Receives one argument,
---- a table with these keys: [event-args]()
+--- value (not `false` or `nil`) to delete the autocommand, and receives one argument, a
+--- table with these keys: [event-args]()
--- - id: (number) autocommand id
--- - event: (string) name of the triggered event `autocmd-events`
--- - group: (number|nil) autocommand group id, if any
@@ -1796,41 +1796,40 @@ function vim.api.nvim_open_term(buffer, opts) end
--- region is hidden by setting `eob` flag of
--- 'fillchars' to a space char, and clearing the
--- `hl-EndOfBuffer` region in 'winhighlight'.
---- - border: Style of (optional) window border. This can either be a string
---- or an array. The string values are the same as those described in 'winborder'.
---- If it is an array, it should have a length of eight or any divisor of
---- eight. The array will specify the eight chars building up the border
---- in a clockwise fashion starting with the top-left corner. As an
---- example, the double box style could be specified as:
---- ```
---- [ "╔", "═" ,"╗", "║", "╝", "═", "╚", "║" ].
---- ```
---- If the number of chars are less than eight, they will be repeated. Thus
---- an ASCII border could be specified as
---- ```
---- [ "/", "-", \"\\\\\", "|" ],
---- ```
---- or all chars the same as
---- ```
---- [ "x" ].
---- ```
---- An empty string can be used to turn off a specific border, for instance,
+--- - border: (`string|string[]`) (defaults to 'winborder' option) Window border. The string form
+--- accepts the same values as the 'winborder' option. The array form must have a length of
+--- eight or any divisor of eight, specifying the chars that form the border in a clockwise
+--- fashion starting from the top-left corner. For example, the double-box style can be
+--- specified as:
--- ```
---- [ "", "", "", ">", "", "", "", "<" ]
+--- [ "╔", "═" ,"╗", "║", "╝", "═", "╚", "║" ].
--- ```
---- will only make vertical borders but not horizontal ones.
---- By default, `FloatBorder` highlight is used, which links to `WinSeparator`
---- when not defined. It could also be specified by character:
+--- If fewer than eight chars are given, they will be repeated. An ASCII border could be
+--- specified as:
--- ```
---- [ ["+", "MyCorner"], ["x", "MyBorder"] ].
+--- [ "/", "-", \"\\\\\", "|" ],
--- ```
---- - title: Title (optional) in window border, string or list.
+--- Or one char for all sides:
+--- ```
+--- [ "x" ].
+--- ```
+--- Empty string can be used to hide a specific border. This example will show only vertical
+--- borders, not horizontal:
+--- ```
+--- [ "", "", "", ">", "", "", "", "<" ]
+--- ```
+--- By default, `hl-FloatBorder` highlight is used, which links to `hl-WinSeparator` when not
+--- defined. Each border side can specify an optional highlight:
+--- ```
+--- [ ["+", "MyCorner"], ["x", "MyBorder"] ].
+--- ```
+--- - title: (optional) Title in window border, string or list.
--- List should consist of `[text, highlight]` tuples.
--- If string, or a tuple lacks a highlight, the default highlight group is `FloatTitle`.
--- - title_pos: Title position. Must be set with `title` option.
--- Value can be one of "left", "center", or "right".
--- Default is `"left"`.
---- - footer: Footer (optional) in window border, string or list.
+--- - footer: (optional) Footer in window border, string or list.
--- List should consist of `[text, highlight]` tuples.
--- If string, or a tuple lacks a highlight, the default highlight group is `FloatFooter`.
--- - footer_pos: Footer position. Must be set with `footer` option.
diff --git a/runtime/lua/vim/_meta/options.lua b/runtime/lua/vim/_meta/options.lua
index 20d8ac3058..9ff4770e7c 100644
--- a/runtime/lua/vim/_meta/options.lua
+++ b/runtime/lua/vim/_meta/options.lua
@@ -1716,6 +1716,21 @@ vim.go.dex = vim.go.diffexpr
--- Use the indent heuristic for the internal
--- diff library.
---
+--- inline:{text} Highlight inline differences within a change.
+--- See `view-diffs`. Supported values are:
+---
+--- none Do not perform inline highlighting.
+--- simple Highlight from first different
+--- character to the last one in each
+--- line. This is the default if no
+--- `inline:` value is set.
+--- char Use internal diff to perform a
+--- character-wise diff and highlight the
+--- difference.
+--- word Use internal diff to perform a
+--- `word`-wise diff and highlight the
+--- difference.
+---
--- internal Use the internal diff library. This is
--- ignored when 'diffexpr' is set. *E960*
--- When running out of memory when writing a
@@ -1766,7 +1781,7 @@ vim.go.dex = vim.go.diffexpr
---
---
--- @type string
-vim.o.diffopt = "internal,filler,closeoff,linematch:40"
+vim.o.diffopt = "internal,filler,closeoff,inline:simple,linematch:40"
vim.o.dip = vim.o.diffopt
vim.go.diffopt = vim.o.diffopt
vim.go.dip = vim.go.diffopt
@@ -4787,6 +4802,17 @@ vim.o.ph = vim.o.pumheight
vim.go.pumheight = vim.o.pumheight
vim.go.ph = vim.go.pumheight
+--- Maximum width for the popup menu (`ins-completion-menu`). When zero,
+--- there is no maximum width limit, otherwise the popup menu will never be
+--- wider than this value. Truncated text will be indicated by "..." at the
+--- end. Takes precedence over 'pumwidth'.
+---
+--- @type integer
+vim.o.pummaxwidth = 0
+vim.o.pmw = vim.o.pummaxwidth
+vim.go.pummaxwidth = vim.o.pummaxwidth
+vim.go.pmw = vim.go.pummaxwidth
+
--- Minimum width for the popup menu (`ins-completion-menu`). If the
--- cursor column + 'pumwidth' exceeds screen width, the popup menu is
--- nudged to fit on the screen.
diff --git a/runtime/lua/vim/health.lua b/runtime/lua/vim/health.lua
index c790779d51..294f2a357a 100644
--- a/runtime/lua/vim/health.lua
+++ b/runtime/lua/vim/health.lua
@@ -275,7 +275,7 @@ end
---
--- @param msg string
function M.ok(msg)
- local input = format_report_message('OK', msg)
+ local input = format_report_message('✅ OK', msg)
collect_output(input)
end
@@ -284,7 +284,7 @@ end
--- @param msg string
--- @param ... string|string[] Optional advice
function M.warn(msg, ...)
- local input = format_report_message('WARNING', msg, ...)
+ local input = format_report_message('⚠️ WARNING', msg, ...)
collect_output(input)
end
@@ -293,7 +293,7 @@ end
--- @param msg string
--- @param ... string|string[] Optional advice
function M.error(msg, ...)
- local input = format_report_message('ERROR', msg, ...)
+ local input = format_report_message('❌ ERROR', msg, ...)
collect_output(input)
end
@@ -449,11 +449,15 @@ function M._check(mods, plugin_names)
vim.print('')
-- Quit with 'q' inside healthcheck buffers.
- vim.keymap.set('n', 'q', function()
- if not pcall(vim.cmd.close) then
- vim.cmd.bdelete()
+ vim._with({ buf = bufnr }, function()
+ if vim.fn.maparg('q', 'n', false, false) == '' then
+ vim.keymap.set('n', 'q', function()
+ if not pcall(vim.cmd.close) then
+ vim.cmd.bdelete()
+ end
+ end, { buffer = bufnr, silent = true, noremap = true, nowait = true })
end
- end, { buffer = bufnr, silent = true, noremap = true, nowait = true })
+ end)
-- Once we're done writing checks, set nomodifiable.
vim.bo[bufnr].modifiable = false
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua
index bb4e1cd28f..995340d751 100644
--- a/runtime/lua/vim/lsp.lua
+++ b/runtime/lua/vim/lsp.lua
@@ -296,49 +296,64 @@ end
--- root_dir matches.
--- @field reuse_client? fun(client: vim.lsp.Client, config: vim.lsp.ClientConfig): boolean
---- Update the configuration for an LSP client.
+--- Sets the default configuration for an LSP client (or _all_ clients if the special name "*" is
+--- used).
---
---- Use name '*' to set default configuration for all clients.
----
---- Can also be table-assigned to redefine the configuration for a client.
+--- Can also be accessed by table-indexing (`vim.lsp.config[…]`) to get the resolved config, or
+--- redefine the config (instead of "merging" with the config chain).
---
--- Examples:
---
---- - Add a root marker for all clients:
+--- - Add root markers for ALL clients:
+--- ```lua
+--- vim.lsp.config('*', {
+--- root_markers = { '.git', '.hg' },
+--- })
+--- ```
+--- - Add capabilities to ALL clients:
--- ```lua
---- vim.lsp.config('*', {
---- root_markers = { '.git' },
---- })
---- ```
---- - Add additional capabilities to all clients:
+--- vim.lsp.config('*', {
+--- capabilities = {
+--- textDocument = {
+--- semanticTokens = {
+--- multilineTokenSupport = true,
+--- }
+--- }
+--- }
+--- })
+--- ```
+--- - Add root markers and capabilities for "clangd":
--- ```lua
---- vim.lsp.config('*', {
---- capabilities = {
---- textDocument = {
---- semanticTokens = {
---- multilineTokenSupport = true,
---- }
---- }
---- }
---- })
---- ```
---- - (Re-)define the configuration for clangd:
+--- vim.lsp.config('clangd', {
+--- root_markers = { '.clang-format', 'compile_commands.json' },
+--- capabilities = {
+--- textDocument = {
+--- completion = {
+--- completionItem = {
+--- snippetSupport = true,
+--- }
+--- }
+--- }
+--- }
+--- })
+--- ```
+--- - (Re-)define the "clangd" configuration (overrides the resolved chain):
--- ```lua
---- vim.lsp.config.clangd = {
---- cmd = {
---- 'clangd',
---- '--clang-tidy',
---- '--background-index',
---- '--offset-encoding=utf-8',
---- },
---- root_markers = { '.clangd', 'compile_commands.json' },
---- filetypes = { 'c', 'cpp' },
---- }
---- ```
---- - Get configuration for luals:
+--- vim.lsp.config.clangd = {
+--- cmd = {
+--- 'clangd',
+--- '--clang-tidy',
+--- '--background-index',
+--- '--offset-encoding=utf-8',
+--- },
+--- root_markers = { '.clangd', 'compile_commands.json' },
+--- filetypes = { 'c', 'cpp' },
+--- }
+--- ```
+--- - Get the resolved configuration for "luals":
--- ```lua
---- local cfg = vim.lsp.config.luals
---- ```
+--- local cfg = vim.lsp.config.luals
+--- ```
---
--- @param name string
--- @param cfg vim.lsp.Config
@@ -615,6 +630,17 @@ function lsp.start(config, opts)
config.root_dir = vim.fs.root(bufnr, opts._root_markers)
end
+ if
+ not config.root_dir
+ and (not config.workspace_folders or #config.workspace_folders == 0)
+ and config.workspace_required
+ then
+ log.info(
+ ('skipping config "%s": workspace_required=true, no workspace found'):format(config.name)
+ )
+ return
+ end
+
for _, client in pairs(all_clients) do
if reuse_client(client, config) then
if opts.attach == false then
@@ -1230,7 +1256,9 @@ end
---
---@param bufnr integer Buffer handle, or 0 for current.
---@param method string LSP method name
----@param params table? Parameters to send to the server
+---@param params? table|(fun(client: vim.lsp.Client, bufnr: integer): table?) Parameters to send to the server.
+--- Can also be passed as a function that returns the params table for cases where
+--- parameters are specific to the client.
---@param timeout_ms integer? Maximum time in milliseconds to wait for a result.
--- (default: `1000`)
---@return table<integer, {error: lsp.ResponseError?, result: any}>? result Map of client_id:request_result.
@@ -1511,25 +1539,39 @@ function lsp.with(handler, override_config)
end
end
---- Registry for client side commands.
---- This is an extension point for plugins to handle custom commands which are
---- not part of the core language server protocol specification.
+--- Registry (a table) for client-side handlers, for custom server-commands that are not in the LSP
+--- specification.
---
---- The registry is a table where the key is a unique command name,
---- and the value is a function which is called if any LSP action
---- (code action, code lenses, ...) triggers the command.
+--- If an LSP response contains a command which is not found in `vim.lsp.commands`, the command will
+--- be executed via the LSP server using `workspace/executeCommand`.
---
---- If an LSP response contains a command for which no matching entry is
---- available in this registry, the command will be executed via the LSP server
---- using `workspace/executeCommand`.
+--- Each key in the table is a unique command name, and each value is a function which is called
+--- when an LSP action (code action, code lenses, …) triggers the command.
---
---- The first argument to the function will be the `Command`:
+--- - Argument 1 is the `Command`:
+--- ```
--- Command
--- title: String
--- command: String
--- arguments?: any[]
+--- ```
+--- - Argument 2 is the |lsp-handler| `ctx`.
+---
+--- Example:
+---
+--- ```lua
+--- vim.lsp.commands['java.action.generateToStringPrompt'] = function(_, ctx)
+--- require("jdtls.async").run(function()
+--- local _, result = request(ctx.bufnr, 'java/checkToStringStatus', ctx.params)
+--- local fields = ui.pick_many(result.fields, 'Include item in toString?', function(x)
+--- return string.format('%s: %s', x.name, x.type)
+--- end)
+--- local _, edit = request(ctx.bufnr, 'java/generateToString', { context = ctx.params; fields = fields; })
+--- vim.lsp.util.apply_workspace_edit(edit, offset_encoding)
+--- end)
+--- end
+--- ```
---
---- The second argument is the `ctx` of |lsp-handler|
--- @type table<string,function>
lsp.commands = setmetatable({}, {
__newindex = function(tbl, key, value)
diff --git a/runtime/lua/vim/lsp/client.lua b/runtime/lua/vim/lsp/client.lua
index 8c75ee321d..b256eab1a6 100644
--- a/runtime/lua/vim/lsp/client.lua
+++ b/runtime/lua/vim/lsp/client.lua
@@ -63,6 +63,9 @@ local validate = vim.validate
--- folder in this list. See `workspaceFolders` in the LSP spec.
--- @field workspace_folders? lsp.WorkspaceFolder[]
---
+--- (default false) Server requires a workspace (no "single file" support).
+--- @field workspace_required? boolean
+---
--- Map overriding the default capabilities defined by |vim.lsp.protocol.make_client_capabilities()|,
--- passed to the language server on initialization. Hint: use make_client_capabilities() and modify
--- its result.
diff --git a/runtime/lua/vim/lsp/health.lua b/runtime/lua/vim/lsp/health.lua
index 8af9f2f791..04e8393eb3 100644
--- a/runtime/lua/vim/lsp/health.lua
+++ b/runtime/lua/vim/lsp/health.lua
@@ -187,26 +187,32 @@ local function check_enabled_configs()
local config = vim.lsp.config[name]
local text = {} --- @type string[]
text[#text + 1] = ('%s:'):format(name)
- for k, v in
- vim.spairs(config --[[@as table<string,any>]])
- do
- local v_str --- @type string?
- if k == 'name' then
- v_str = nil
- elseif k == 'filetypes' or k == 'root_markers' then
- v_str = table.concat(v, ', ')
- elseif type(v) == 'function' then
- v_str = func_tostring(v)
- else
- v_str = vim.inspect(v, { newline = '\n ' })
- end
+ if not config then
+ report_warn(
+ ("'%s' config not found. Ensure that vim.lsp.config('%s') was called."):format(name, name)
+ )
+ else
+ for k, v in
+ vim.spairs(config --[[@as table<string,any>]])
+ do
+ local v_str --- @type string?
+ if k == 'name' then
+ v_str = nil
+ elseif k == 'filetypes' or k == 'root_markers' then
+ v_str = table.concat(v, ', ')
+ elseif type(v) == 'function' then
+ v_str = func_tostring(v)
+ else
+ v_str = vim.inspect(v, { newline = '\n ' })
+ end
- if k == 'cmd' and type(v) == 'table' and vim.fn.executable(v[1]) == 0 then
- report_warn(("'%s' is not executable. Configuration will not be used."):format(v[1]))
- end
+ if k == 'cmd' and type(v) == 'table' and vim.fn.executable(v[1]) == 0 then
+ report_warn(("'%s' is not executable. Configuration will not be used."):format(v[1]))
+ end
- if v_str then
- text[#text + 1] = ('- %s: %s'):format(k, v_str)
+ if v_str then
+ text[#text + 1] = ('- %s: %s'):format(k, v_str)
+ end
end
end
text[#text + 1] = ''
diff --git a/runtime/lua/vim/lsp/inlay_hint.lua b/runtime/lua/vim/lsp/inlay_hint.lua
index ab3a269937..a37fa42aac 100644
--- a/runtime/lua/vim/lsp/inlay_hint.lua
+++ b/runtime/lua/vim/lsp/inlay_hint.lua
@@ -94,10 +94,10 @@ function M.on_refresh(err, _, ctx)
for _, bufnr in ipairs(vim.lsp.get_buffers_by_client_id(ctx.client_id)) do
for _, winid in ipairs(api.nvim_list_wins()) do
if api.nvim_win_get_buf(winid) == bufnr then
- if bufstates[bufnr] then
+ if bufstates[bufnr] and bufstates[bufnr].enabled then
bufstates[bufnr].applied = {}
+ util._refresh(ms.textDocument_inlayHint, { bufnr = bufnr })
end
- util._refresh(ms.textDocument_inlayHint, { bufnr = bufnr })
end
end
end
diff --git a/runtime/lua/vim/provider/health.lua b/runtime/lua/vim/provider/health.lua
index fa01951b02..e4b5206fa4 100644
--- a/runtime/lua/vim/provider/health.lua
+++ b/runtime/lua/vim/provider/health.lua
@@ -107,9 +107,22 @@ local function provider_disabled(provider)
return false
end
+--- Checks the hygiene of a `g:loaded_xx_provider` variable.
+local function check_loaded_var(var)
+ if vim.g[var] == 1 then
+ health.error(('`g:%s=1` may have been set by mistake.'):format(var), {
+ ('Remove `vim.g.%s=1` from your config.'):format(var),
+ 'To disable the provider, set this to 0, not 1.',
+ 'If you want to enable the provider but skip automatic detection, set the respective `g:…_host_prog` var. See :help provider',
+ })
+ end
+end
+
local function clipboard()
health.start('Clipboard (optional)')
+ check_loaded_var('loaded_clipboard_provider')
+
if
os.getenv('TMUX')
and vim.fn.executable('tmux') == 1
@@ -144,6 +157,8 @@ end
local function node()
health.start('Node.js provider (optional)')
+ check_loaded_var('loaded_node_provider')
+
if provider_disabled('node') then
return
end
@@ -247,6 +262,8 @@ end
local function perl()
health.start('Perl provider (optional)')
+ check_loaded_var('loaded_perl_provider')
+
if provider_disabled('perl') then
return
end
@@ -256,7 +273,7 @@ local function perl()
if not perl_exec then
health.warn(assert(perl_warnings), {
'See :help provider-perl for more information.',
- 'You may disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim',
+ 'You can disable this provider (and warning) by adding `let g:loaded_perl_provider = 0` to your init.vim',
})
health.warn('No usable perl executable found')
return
@@ -547,7 +564,7 @@ local function version_info(python)
local nvim_path_base = vim.fn.fnamemodify(nvim_path, [[:~:h]])
local version_status = 'unknown; ' .. nvim_path_base
- if is_bad_response(nvim_version) and is_bad_response(pypi_version) then
+ if not is_bad_response(nvim_version) and not is_bad_response(pypi_version) then
if vim.version.lt(nvim_version, pypi_version) then
version_status = 'outdated; from ' .. nvim_path_base
else
@@ -561,6 +578,8 @@ end
local function python()
health.start('Python 3 provider (optional)')
+ check_loaded_var('loaded_python3_provider')
+
local python_exe = ''
local virtual_env = os.getenv('VIRTUAL_ENV')
local venv = virtual_env and vim.fn.resolve(virtual_env) or ''
@@ -595,7 +614,7 @@ local function python()
if pythonx_warnings then
health.warn(pythonx_warnings, {
'See :help provider-python for more information.',
- 'You may disable this provider (and warning) by adding `let g:loaded_python3_provider = 0` to your init.vim',
+ 'You can disable this provider (and warning) by adding `let g:loaded_python3_provider = 0` to your init.vim',
})
elseif pyname and pyname ~= '' and python_exe == '' then
if not vim.g[host_prog_var] then
@@ -840,6 +859,8 @@ end
local function ruby()
health.start('Ruby provider (optional)')
+ check_loaded_var('loaded_ruby_provider')
+
if provider_disabled('ruby') then
return
end
@@ -860,7 +881,7 @@ local function ruby()
'Run `gem environment` to ensure the gem bin directory is in $PATH.',
'If you are using rvm/rbenv/chruby, try "rehashing".',
'See :help g:ruby_host_prog for non-standard gem installations.',
- 'You may disable this provider (and warning) by adding `let g:loaded_ruby_provider = 0` to your init.vim',
+ 'You can disable this provider (and warning) by adding `let g:loaded_ruby_provider = 0` to your init.vim',
})
return
end
diff --git a/runtime/lua/vim/provider/python.lua b/runtime/lua/vim/provider/python.lua
index 48f08302f9..a772b36973 100644
--- a/runtime/lua/vim/provider/python.lua
+++ b/runtime/lua/vim/provider/python.lua
@@ -1,5 +1,5 @@
local M = {}
-local min_version = '3.7'
+local min_version = '3.9'
local s_err ---@type string?
local s_host ---@type string?
diff --git a/runtime/lua/vim/treesitter/_headings.lua b/runtime/lua/vim/treesitter/_headings.lua
index 885d014a89..bfa468ad88 100644
--- a/runtime/lua/vim/treesitter/_headings.lua
+++ b/runtime/lua/vim/treesitter/_headings.lua
@@ -40,10 +40,6 @@ local heading_queries = {
]],
}
-local function hash_tick(bufnr)
- return tostring(vim.b[bufnr].changedtick)
-end
-
---@class TS.Heading
---@field bufnr integer
---@field lnum integer
@@ -53,7 +49,7 @@ end
--- Extract headings from buffer
--- @param bufnr integer buffer to extract headings from
--- @return TS.Heading[]
-local get_headings = vim.func._memoize(hash_tick, function(bufnr)
+local get_headings = function(bufnr)
local lang = ts.language.get_lang(vim.bo[bufnr].filetype)
if not lang then
return {}
@@ -85,7 +81,7 @@ local get_headings = vim.func._memoize(hash_tick, function(bufnr)
end
end
return headings
-end)
+end
--- Shows an Outline (table of contents) of the current buffer, in the loclist.
function M.show_toc()
diff --git a/runtime/lua/vim/treesitter/_meta/misc.lua b/runtime/lua/vim/treesitter/_meta/misc.lua
index 07a1c921c7..9b9cc4eb54 100644
--- a/runtime/lua/vim/treesitter/_meta/misc.lua
+++ b/runtime/lua/vim/treesitter/_meta/misc.lua
@@ -5,12 +5,10 @@ error('Cannot require a meta file')
---@alias TSLoggerCallback fun(logtype: 'parse'|'lex', msg: string)
---@class TSParser: userdata
----@field parse fun(self: TSParser, tree: TSTree?, source: integer|string, include_bytes: boolean): TSTree, (Range4|Range6)[]
+---@field parse fun(self: TSParser, tree: TSTree?, source: integer|string, include_bytes: boolean, timeout_ns: integer?): TSTree?, (Range4|Range6)[]
---@field reset fun(self: TSParser)
---@field included_ranges fun(self: TSParser, include_bytes: boolean?): integer[]
---@field set_included_ranges fun(self: TSParser, ranges: (Range6|TSNode)[])
----@field set_timeout fun(self: TSParser, timeout: integer)
----@field timeout fun(self: TSParser): integer
---@field _set_logger fun(self: TSParser, lex: boolean, parse: boolean, cb: TSLoggerCallback)
---@field _logger fun(self: TSParser): TSLoggerCallback
diff --git a/runtime/lua/vim/treesitter/languagetree.lua b/runtime/lua/vim/treesitter/languagetree.lua
index f2e745ec65..6f0e377d2f 100644
--- a/runtime/lua/vim/treesitter/languagetree.lua
+++ b/runtime/lua/vim/treesitter/languagetree.lua
@@ -43,8 +43,10 @@
local query = require('vim.treesitter.query')
local language = require('vim.treesitter.language')
local Range = require('vim.treesitter._range')
+local hrtime = vim.uv.hrtime
-local default_parse_timeout_ms = 3
+-- Parse in 3ms chunks.
+local default_parse_timeout_ns = 3 * 1000000
---@type Range2
local entire_document_range = { 0, math.huge }
@@ -198,16 +200,16 @@ function LanguageTree:_set_logger()
self._parser:_set_logger(log_lex, log_parse, self._logger)
end
----Measure execution time of a function
+---Measure execution time of a function, in nanoseconds.
---@generic R1, R2, R3
---@param f fun(): R1, R2, R3
---@return number, R1, R2, R3
local function tcall(f, ...)
- local start = vim.uv.hrtime()
+ local start = hrtime()
---@diagnostic disable-next-line
local r = { f(...) }
--- @type number
- local duration = (vim.uv.hrtime() - start) / 1000000
+ local duration = hrtime() - start
--- @diagnostic disable-next-line: redundant-return-value
return duration, unpack(r)
end
@@ -388,18 +390,29 @@ function LanguageTree:_parse_regions(range, thread_state)
)
then
self._parser:set_included_ranges(ranges)
- self._parser:set_timeout(thread_state.timeout and thread_state.timeout * 1000 or 0) -- ms -> micros
- local parse_time, tree, tree_changes =
- tcall(self._parser.parse, self._parser, self._trees[i], self._source, true)
+ local parse_time, tree, tree_changes = tcall(
+ self._parser.parse,
+ self._parser,
+ self._trees[i],
+ self._source,
+ true,
+ thread_state.timeout
+ )
while true do
if tree then
break
end
coroutine.yield(self._trees, false)
- parse_time, tree, tree_changes =
- tcall(self._parser.parse, self._parser, self._trees[i], self._source, true)
+ parse_time, tree, tree_changes = tcall(
+ self._parser.parse,
+ self._parser,
+ self._trees[i],
+ self._source,
+ true,
+ thread_state.timeout
+ )
end
self:_subtract_time(thread_state, parse_time)
@@ -503,7 +516,7 @@ function LanguageTree:_async_parse(range, on_parse)
local buf = is_buffer_parser and vim.b[source] or nil
local ct = is_buffer_parser and buf.changedtick or nil
local total_parse_time = 0
- local redrawtime = vim.o.redrawtime
+ local redrawtime = vim.o.redrawtime * 1000000
local thread_state = {} ---@type ParserThreadState
@@ -526,7 +539,7 @@ function LanguageTree:_async_parse(range, on_parse)
end
end
- thread_state.timeout = not vim.g._ts_force_sync_parsing and default_parse_timeout_ms or nil
+ thread_state.timeout = not vim.g._ts_force_sync_parsing and default_parse_timeout_ns or nil
local parse_time, trees, finished = tcall(parse, self, range, thread_state)
total_parse_time = total_parse_time + parse_time
@@ -868,35 +881,42 @@ end
---@alias vim.treesitter.languagetree.Injection table<string,table<integer,vim.treesitter.languagetree.InjectionElem>>
----@param t table<integer,vim.treesitter.languagetree.Injection>
----@param tree_index integer
+---@param t vim.treesitter.languagetree.Injection
---@param pattern integer
---@param lang string
---@param combined boolean
---@param ranges Range6[]
-local function add_injection(t, tree_index, pattern, lang, combined, ranges)
+---@param result table<string,Range6[][]>
+local function add_injection(t, pattern, lang, combined, ranges, result)
if #ranges == 0 then
-- Make sure not to add an empty range set as this is interpreted to mean the whole buffer.
return
end
- -- Each tree index should be isolated from the other nodes.
- if not t[tree_index] then
- t[tree_index] = {}
+ if not result[lang] then
+ result[lang] = {}
end
- if not t[tree_index][lang] then
- t[tree_index][lang] = {}
+ if not combined then
+ table.insert(result[lang], ranges)
+ return
end
- -- Key this by pattern. If combined is set to true all captures of this pattern
+ if not t[lang] then
+ t[lang] = {}
+ end
+
+ -- Key this by pattern. For combined injections, all captures of this pattern
-- will be parsed by treesitter as the same "source".
- -- If combined is false, each "region" will be parsed as a single source.
- if not t[tree_index][lang][pattern] then
- t[tree_index][lang][pattern] = { combined = combined, regions = {} }
+ if not t[lang][pattern] then
+ local regions = {}
+ t[lang][pattern] = regions
+ table.insert(result[lang], regions)
end
- table.insert(t[tree_index][lang][pattern].regions, ranges)
+ for _, range in ipairs(ranges) do
+ table.insert(t[lang][pattern], range)
+ end
end
-- TODO(clason): replace by refactored `ts.has_parser` API (without side effects)
@@ -964,19 +984,6 @@ function LanguageTree:_get_injection(match, metadata)
return lang, combined, ranges
end
---- Can't use vim.tbl_flatten since a range is just a table.
----@param regions Range6[][]
----@return Range6[]
-local function combine_regions(regions)
- local result = {} ---@type Range6[]
- for _, region in ipairs(regions) do
- for _, range in ipairs(region) do
- result[#result + 1] = range
- end
- end
- return result
-end
-
--- Gets language injection regions by language.
---
--- This is where most of the injection processing occurs.
@@ -993,13 +1000,16 @@ function LanguageTree:_get_injections(range, thread_state)
return {}
end
- ---@type table<integer,vim.treesitter.languagetree.Injection>
- local injections = {}
- local start = vim.uv.hrtime()
+ local start = hrtime()
+
+ ---@type table<string,Range6[][]>
+ local result = {}
local full_scan = range == true or self._injection_query.has_combined_injections
- for index, tree in pairs(self._trees) do
+ for _, tree in pairs(self._trees) do
+ ---@type vim.treesitter.languagetree.Injection
+ local injections = {}
local root_node = tree:root()
local start_line, end_line ---@type integer, integer
if full_scan then
@@ -1013,38 +1023,15 @@ function LanguageTree:_get_injections(range, thread_state)
do
local lang, combined, ranges = self:_get_injection(match, metadata)
if lang then
- add_injection(injections, index, pattern, lang, combined, ranges)
+ add_injection(injections, pattern, lang, combined, ranges, result)
else
self:_log('match from injection query failed for pattern', pattern)
end
-- Check the current function duration against the timeout, if it exists.
- local current_time = vim.uv.hrtime()
- self:_subtract_time(thread_state, (current_time - start) / 1000000)
- start = current_time
- end
- end
-
- ---@type table<string,Range6[][]>
- local result = {}
-
- -- Generate a map by lang of node lists.
- -- Each list is a set of ranges that should be parsed together.
- for _, lang_map in pairs(injections) do
- for lang, patterns in pairs(lang_map) do
- if not result[lang] then
- result[lang] = {}
- end
-
- for _, entry in pairs(patterns) do
- if entry.combined then
- table.insert(result[lang], combine_regions(entry.regions))
- else
- for _, ranges in pairs(entry.regions) do
- table.insert(result[lang], ranges)
- end
- end
- end
+ local current_time = hrtime()
+ self:_subtract_time(thread_state, current_time - start)
+ start = hrtime()
end
end
diff --git a/runtime/nvim.desktop b/runtime/nvim.desktop
index f9feae926d..50326fa618 100644
--- a/runtime/nvim.desktop
+++ b/runtime/nvim.desktop
@@ -78,7 +78,7 @@ Comment[wa]=Asspougnî des fitchîs tecses
Comment[zh_CN]=编辑文本文件
Comment[zh_TW]=編輯文字檔
TryExec=nvim
-Exec=nvim %F
+Exec=nvim "%F"
Terminal=true
Type=Application
Keywords=Text;editor;
diff --git a/runtime/optwin.vim b/runtime/optwin.vim
index 56fbb954a7..ce4590f01b 100644
--- a/runtime/optwin.vim
+++ b/runtime/optwin.vim
@@ -1,7 +1,7 @@
" These commands create the option window.
"
" Maintainer: The Vim Project <https://github.com/vim/vim>
-" Last Change: 2025 Mar 07
+" Last Change: 2025 Mar 28
" Former Maintainer: Bram Moolenaar <Bram@vim.org>
" If there already is an option window, jump to that one.
@@ -736,6 +736,8 @@ if has("insert_expand")
call <SID>OptionG("ph", &ph)
call <SID>AddOption("pumwidth", gettext("minimum width of the popup menu"))
call <SID>OptionG("pw", &pw)
+ call <SID>AddOption("pummaxwidth", gettext("maximum width of the popup menu"))
+ call <SID>OptionG("pmw", &pmw)
call <SID>AddOption("completefunc", gettext("user defined function for Insert mode completion"))
call append("$", "\t" .. s:local_to_buffer)
call <SID>OptionL("cfu")
diff --git a/runtime/syntax/hyprlang.vim b/runtime/syntax/hyprlang.vim
index cde504d9ca..081d917b4c 100644
--- a/runtime/syntax/hyprlang.vim
+++ b/runtime/syntax/hyprlang.vim
@@ -1,11 +1,14 @@
" Vim syntax file
" Language: hyprlang
" Maintainer: Luca Saccarola <github.e41mv@aleeas.com>
-" Last Change: 2025 Jan 29
+" Last Change: 2025 Mar 26
if exists("b:current_syntax")
finish
endif
+let s:cpo= &cpo
+set cpo&vim
+
let b:current_syntax = "hyprlang"
syn case ignore
@@ -56,4 +59,6 @@ hi def link hyprString String
hi def link hyprColor Structure
hi def link hyprCommand Keyword
+let &cpo = s:cpo
+unlet s:cpo
" vim: ts=8 sts=2 sw=2 et
diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim
index 9b38ccd4dc..8dabc5e3df 100644
--- a/runtime/syntax/java.vim
+++ b/runtime/syntax/java.vim
@@ -3,7 +3,7 @@
" Maintainer: Aliaksei Budavei <0x000c70 AT gmail DOT com>
" Former Maintainer: Claudio Fleiner <claudio@fleiner.com>
" Repository: https://github.com/zzzyxwvut/java-vim.git
-" Last Change: 2025 Jan 02
+" Last Change: 2025 Mar 26
" Please check ":help java.vim" for comments on some of the options
" available.
@@ -46,8 +46,10 @@ function! s:ff.RightConstant(x, y) abort
return a:y
endfunction
-function! s:ff.IsRequestedPreviewFeature(n) abort
- return exists("g:java_syntax_previews") && index(g:java_syntax_previews, a:n) + 1
+function! s:ff.IsAnyRequestedPreviewFeatureOf(ns) abort
+ return exists("g:java_syntax_previews") &&
+ \ !empty(filter(a:ns, printf('index(%s, v:val) + 1',
+ \ string(g:java_syntax_previews))))
endfunction
if !exists("*s:ReportOnce")
@@ -108,7 +110,7 @@ syn keyword javaTypedef this super
syn keyword javaOperator new instanceof
syn match javaOperator "\<var\>\%(\s*(\)\@!"
-if s:ff.IsRequestedPreviewFeature(476)
+if s:ff.IsAnyRequestedPreviewFeatureOf([476, 494])
" Module imports can be used in any source file.
syn match javaExternal "\<import\s\+module\>" contains=javaModuleImport
syn keyword javaModuleImport contained module
@@ -262,8 +264,12 @@ if exists("g:java_highlight_all") || exists("g:java_highlight_java") || exists("
syn keyword javaC_JavaLang Class InheritableThreadLocal ThreadLocal Enum ClassValue
endif
- " As of JDK 21, java.lang.Compiler is no more (deprecated in JDK 9).
- syn keyword javaLangDeprecated Compiler
+ " As of JDK 24, SecurityManager is rendered non-functional
+ " (JDK-8338625).
+ " (Note that SecurityException and RuntimePermission are still
+ " not deprecated.)
+ " As of JDK 21, Compiler is no more (JDK-8205129).
+ syn keyword javaLangDeprecated Compiler SecurityManager
syn cluster javaClasses add=javaC_JavaLang
hi def link javaC_JavaLang javaC_Java
syn keyword javaE_JavaLang AbstractMethodError ClassCircularityError ClassFormatError Error IllegalAccessError IncompatibleClassChangeError InstantiationError InternalError LinkageError NoClassDefFoundError NoSuchFieldError NoSuchMethodError OutOfMemoryError StackOverflowError ThreadDeath UnknownError UnsatisfiedLinkError VerifyError VirtualMachineError ExceptionInInitializerError UnsupportedClassVersionError AssertionError BootstrapMethodError
@@ -311,7 +317,7 @@ endif
exec 'syn match javaUserLabel "^\s*\<\K\k*\>\%(\<default\>\)\@' . s:ff.Peek('7', '') . '<!\s*::\@!"he=e-1'
-if s:ff.IsRequestedPreviewFeature(455)
+if s:ff.IsAnyRequestedPreviewFeatureOf([455, 488])
syn region javaLabelRegion transparent matchgroup=javaLabel start="\<case\>" matchgroup=NONE end=":\|->" contains=javaBoolean,javaNumber,javaCharacter,javaString,javaConstant,@javaClasses,javaGenerics,javaType,javaLabelDefault,javaLabelVarType,javaLabelWhenClause
else
syn region javaLabelRegion transparent matchgroup=javaLabel start="\<case\>" matchgroup=NONE end=":\|->" contains=javaLabelCastType,javaLabelNumber,javaCharacter,javaString,javaConstant,@javaClasses,javaGenerics,javaLabelDefault,javaLabelVarType,javaLabelWhenClause
@@ -609,7 +615,7 @@ syn region javaString start=+"+ end=+"+ end=+$+ contains=javaSpecialChar,javaS
syn region javaString start=+"""[ \t\x0c\r]*$+hs=e+1 end=+"""+he=s-1 contains=javaSpecialChar,javaSpecialError,javaTextBlockError,@Spell
syn match javaTextBlockError +"""\s*"""+
-if s:ff.IsRequestedPreviewFeature(430)
+if s:ff.IsAnyRequestedPreviewFeatureOf([430])
syn region javaStrTemplEmbExp contained matchgroup=javaStrTempl start="\\{" end="}" contains=TOP
exec 'syn region javaStrTempl start=+\%(\.[[:space:]\n]*\)\@' . s:ff.Peek('80', '') . '<="+ end=+"+ contains=javaStrTemplEmbExp,javaSpecialChar,javaSpecialError,@Spell'
exec 'syn region javaStrTempl start=+\%(\.[[:space:]\n]*\)\@' . s:ff.Peek('80', '') . '<="""[ \t\x0c\r]*$+hs=e+1 end=+"""+he=s-1 contains=javaStrTemplEmbExp,javaSpecialChar,javaSpecialError,javaTextBlockError,@Spell'
@@ -688,7 +694,7 @@ if exists("g:java_highlight_debug")
syn region javaDebugString contained start=+"+ end=+"+ contains=javaDebugSpecial
syn region javaDebugString contained start=+"""[ \t\x0c\r]*$+hs=e+1 end=+"""+he=s-1 contains=javaDebugSpecial,javaDebugTextBlockError
- if s:ff.IsRequestedPreviewFeature(430)
+ if s:ff.IsAnyRequestedPreviewFeatureOf([430])
" The highlight groups of java{StrTempl,Debug{,Paren,StrTempl}}\,
" share one colour by default. Do not conflate unrelated parens.
syn region javaDebugStrTemplEmbExp contained matchgroup=javaDebugStrTempl start="\\{" end="}" contains=javaComment,javaLineComment,javaDebug\%(Paren\)\@!.*
diff --git a/runtime/syntax/lf.vim b/runtime/syntax/lf.vim
index e4cf014865..3c1513fe68 100644
--- a/runtime/syntax/lf.vim
+++ b/runtime/syntax/lf.vim
@@ -2,15 +2,18 @@
" Language: lf file manager configuration file (lfrc)
" Maintainer: Andis Sprinkis <andis@sprinkis.com>
" Former Maintainer: Cameron Wright
-" Former URL: https://github.com/andis-sprinkis/lf-vim
-" Last Change: 13 October 2024
+" URL: https://github.com/andis-sprinkis/lf-vim
+" Last Change: 28 March 2025
+" 29 Mar 2025 by Vim Project (save and restore 'cpo' setting)
"
" The shell syntax highlighting is configurable. See $VIMRUNTIME/doc/syntax.txt
-" lf version: 32
+" lf version: 34
if exists("b:current_syntax")
finish
endif
+let s:cpo = &cpo
+set cpo&vim
let b:current_syntax = "lf"
@@ -33,122 +36,80 @@ syn keyword lfKeyword set setlocal cmd map cmap skipwhite
"{{{ Options Keywords
syn keyword lfOptions
- \ quit
- \ up
- \ half-up
- \ page-up
- \ scroll-up
- \ down
- \ half-down
- \ page-down
- \ scroll-down
- \ updir
- \ open
- \ jump-next
- \ jump-prev
- \ top
+ \ anchorfind
+ \ autoquit
+ \ borderfmt
\ bottom
- \ high
- \ middle
- \ low
- \ toggle
- \ invert
- \ invert-below
- \ unselect
- \ glob-select
- \ glob-unselect
\ calcdirsize
- \ clearmaps
- \ copy
- \ cut
- \ paste
- \ clear
- \ sync
- \ draw
- \ redraw
- \ load
- \ reload
- \ echo
- \ echomsg
- \ echoerr
\ cd
- \ select
- \ delete
- \ rename
- \ source
- \ push
- \ read
- \ shell
- \ shell-pipe
- \ shell-wait
- \ shell-async
- \ find
- \ find-back
- \ find-next
- \ find-prev
- \ search
- \ search-back
- \ search-next
- \ search-prev
- \ filter
- \ setfilter
- \ mark-save
- \ mark-load
- \ mark-remove
- \ tag
- \ tag-toggle
- \ cmd-escape
+ \ cleaner
+ \ clear
+ \ clearmaps
+ \ cmd-capitalize-word
\ cmd-complete
- \ cmd-menu-complete
- \ cmd-menu-complete-back
- \ cmd-menu-accept
+ \ cmd-delete
+ \ cmd-delete-back
+ \ cmd-delete-end
+ \ cmd-delete-home
+ \ cmd-delete-unix-word
+ \ cmd-delete-word
+ \ cmd-delete-word-back
+ \ cmd-end
\ cmd-enter
- \ cmd-interrupt
+ \ cmd-escape
\ cmd-history-next
\ cmd-history-prev
+ \ cmd-home
+ \ cmd-interrupt
\ cmd-left
+ \ cmd-lowercase-word
+ \ cmd-menu-accept
+ \ cmd-menu-complete
+ \ cmd-menu-complete-back
\ cmd-right
- \ cmd-home
- \ cmd-end
- \ cmd-delete
- \ cmd-delete-back
- \ cmd-delete-home
- \ cmd-delete-end
- \ cmd-delete-unix-word
- \ cmd-yank
\ cmd-transpose
\ cmd-transpose-word
+ \ cmd-uppercase-word
\ cmd-word
\ cmd-word-back
- \ cmd-delete-word
- \ cmd-delete-word-back
- \ cmd-capitalize-word
- \ cmd-uppercase-word
- \ cmd-lowercase-word
- \ anchorfind
- \ autoquit
- \ borderfmt
- \ cleaner
+ \ cmd-yank
+ \ copy
\ copyfmt
\ cursoractivefmt
\ cursorparentfmt
\ cursorpreviewfmt
+ \ cut
\ cutfmt
+ \ delete
\ dircache
\ dircounts
\ dirfirst
\ dironly
\ dirpreviews
+ \ down
+ \ draw
\ drawbox
\ dupfilefmt
+ \ echo
+ \ echoerr
+ \ echomsg
\ errorfmt
\ filesep
+ \ filter
+ \ find
+ \ find-back
+ \ find-next
+ \ find-prev
\ findlen
+ \ glob-select
+ \ glob-unselect
\ globfilter
\ globsearch
+ \ half-down
+ \ half-up
\ hidden
\ hiddenfiles
- \ hidecursorinactive
+ \ high
\ history
\ icons
\ ifs
@@ -159,45 +120,90 @@ syn keyword lfOptions
\ info
\ infotimefmtnew
\ infotimefmtold
+ \ invert
+ \ invert-below
+ \ jump-next
+ \ jump-prev
+ \ load
+ \ locale
+ \ low
+ \ mark-load
+ \ mark-remove
+ \ mark-save
+ \ middle
\ mouse
\ number
\ numberfmt
+ \ on-cd
+ \ on-focus-gained
+ \ on-focus-lost
+ \ on-init
+ \ on-quit
+ \ on-redraw
+ \ on-select
+ \ open
+ \ page-down
+ \ page-up
+ \ paste
\ period
+ \ pre-cd
\ preserve
\ preview
\ previewer
\ promptfmt
+ \ push
+ \ quit
\ ratios
+ \ read
+ \ redraw
\ relativenumber
+ \ reload
+ \ rename
\ reverse
\ roundbox
- \ ruler
\ rulerfmt
+ \ scroll-down
+ \ scroll-up
\ scrolloff
+ \ search
+ \ search-back
+ \ search-next
+ \ search-prev
+ \ select
\ selectfmt
\ selmode
+ \ setfilter
\ shell
+ \ shell-async
+ \ shell-pipe
+ \ shell-wait
\ shellflag
\ shellopts
+ \ showbinds
\ sixel
\ smartcase
\ smartdia
\ sortby
+ \ source
\ statfmt
+ \ sync
\ tabstop
+ \ tag
+ \ tag-toggle
\ tagfmt
\ tempmarks
\ timefmt
+ \ toggle
+ \ top
\ truncatechar
\ truncatepct
+ \ unselect
+ \ up
+ \ updir
\ waitmsg
+ \ watch
\ wrapscan
\ wrapscroll
- \ pre-cd
- \ on-cd
- \ on-select
- \ on-redraw
- \ on-quit
"}}}
"{{{ Special Matching
@@ -234,3 +240,5 @@ hi def link lfExternalShell Normal
hi def link lfExternalPatch Special
hi def link lfIgnore Special
"}}}
+let &cpo = s:cpo
+unlet s:cpo
diff --git a/runtime/syntax/solidity.vim b/runtime/syntax/solidity.vim
index a46d041a10..5391bba707 100644
--- a/runtime/syntax/solidity.vim
+++ b/runtime/syntax/solidity.vim
@@ -2,10 +2,11 @@
" Language: Solidity
" Maintainer: Cothi (jiungdev@gmail.com)
" Original Author: tomlion (https://github.com/tomlion/vim-solidity/blob/master/syntax/solidity.vim)
-" Last Change: 2022 Sep 27
+" Last Change: 2025 Mar 25
"
" Contributors:
" Modified by thesis (https://github.com/thesis/vim-solidity/blob/main/indent/solidity.vim)
+" Modified by S0AndS0 (https://github.com/S0AndS0/vim/blob/syntax-solidity-updates/runtime/syntax/solidity.vim)
if exists("b:current_syntax")
finish
@@ -15,7 +16,7 @@ endif
syn keyword solKeyword abstract anonymous as break calldata case catch constant constructor continue default switch revert require
syn keyword solKeyword ecrecover addmod mulmod keccak256
syn keyword solKeyword delete do else emit enum external final for function if immutable import in indexed inline
-syn keyword solKeyword interface internal is let match memory modifier new of payable pragma private public pure override virtual
+syn keyword solKeyword interface internal is let match memory modifier new of payable pragma private public pure override virtual transient
syn keyword solKeyword relocatable return returns static storage struct throw try type typeof using
syn keyword solKeyword var view while
@@ -158,6 +159,15 @@ hi def link solEvent Type
hi def link solEventName Function
hi def link solEventArgSpecial Label
+" Error
+syn match solError /\<error\>/ nextgroup=solErrorName,solErrorArgs skipwhite
+syn match solErrorName contained /\<[a-zA-Z_$][0-9a-zA-Z_$]*/ nextgroup=solErrorArgs skipwhite
+syn region solErrorArgs contained matchgroup=solFuncParens start='(' end=')' contains=solErrorArgCommas,solBuiltinType skipwhite skipempty
+syn match solErrorArgCommas contained ','
+
+hi def link solError Type
+hi def link solErrorName Function
+
" Comment
syn keyword solCommentTodo TODO FIXME XXX TBD contained
syn match solNatSpec contained /@title\|@author\|@notice\|@dev\|@param\|@inheritdoc\|@return/
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index 7fe22190b7..29d9856b3d 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -60,7 +60,7 @@ syn case ignore
syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo
" Default highlighting groups {{{2
-syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit DiffText PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel ComplMatchIns Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC CursorIM LineNrAbove LineNrBelow
+syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit DiffText DiffTextAdd PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel ComplMatchIns Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC CursorIM LineNrAbove LineNrBelow
syn match vimHLGroup contained "\<Conceal\>"
syn keyword vimOnlyHLGroup contained Menu Scrollbar ToolbarButton ToolbarLine Tooltip VisualNOS
syn keyword nvimHLGroup contained FloatBorder FloatFooter FloatTitle MsgSeparator NormalFloat NormalNC Substitute TermCursor VisualNC Whitespace WinBar WinBarNC WinSeparator