aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc')
-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
15 files changed, 323 insertions, 285 deletions
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)