mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
docs: misc #31867
This commit is contained in:
parent
0c296ab224
commit
7c00e0efbb
2
.github/workflows/vim_patches.yml
vendored
2
.github/workflows/vim_patches.yml
vendored
@ -43,7 +43,7 @@ jobs:
|
|||||||
id: update-version
|
id: update-version
|
||||||
run: |
|
run: |
|
||||||
git checkout -b ${VERSION_BRANCH}
|
git checkout -b ${VERSION_BRANCH}
|
||||||
nvim -V1 -es -i NONE +'luafile scripts/vimpatch.lua' +q
|
nvim -l scripts/vimpatch.lua
|
||||||
printf 'NEW_PATCHES=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
|
printf 'NEW_PATCHES=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Automatic PR
|
- name: Automatic PR
|
||||||
|
@ -654,20 +654,22 @@ nvim_del_var({name}) *nvim_del_var()*
|
|||||||
• {name} Variable name
|
• {name} Variable name
|
||||||
|
|
||||||
nvim_echo({chunks}, {history}, {opts}) *nvim_echo()*
|
nvim_echo({chunks}, {history}, {opts}) *nvim_echo()*
|
||||||
Echo a message.
|
Prints a message given by a list of `[text, hl_group]` "chunks".
|
||||||
|
|
||||||
|
Example: >lua
|
||||||
|
vim.api.nvim_echo({ { 'chunk1-line1\nchunk1-line2\n' }, { 'chunk2-line1' } }, true, {})
|
||||||
|
<
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
• {chunks} A list of `[text, hl_group]` arrays, each representing a
|
• {chunks} List of `[text, hl_group]` pairs, where each is a `text`
|
||||||
text chunk with specified highlight group name or ID.
|
string highlighted by the (optional) name or ID `hl_group`.
|
||||||
`hl_group` element can be omitted for no highlight.
|
|
||||||
• {history} if true, add to |message-history|.
|
• {history} if true, add to |message-history|.
|
||||||
• {opts} Optional parameters.
|
• {opts} Optional parameters.
|
||||||
• err: Treat the message like |:echoerr|. Omitted `hlgroup`
|
• err: Treat the message like `:echoerr`. Sets `hl_group`
|
||||||
uses |hl-ErrorMsg| instead.
|
to |hl-ErrorMsg| by default.
|
||||||
• verbose: Message is printed as a result of 'verbose'
|
• verbose: Message is controlled by the 'verbose' option.
|
||||||
option. If Nvim was invoked with -V3log_file, the message
|
Nvim invoked with `-V3log` will write the message to the
|
||||||
will be redirected to the log_file and suppressed from
|
"log" file instead of standard output.
|
||||||
direct output.
|
|
||||||
|
|
||||||
nvim_eval_statusline({str}, {opts}) *nvim_eval_statusline()*
|
nvim_eval_statusline({str}, {opts}) *nvim_eval_statusline()*
|
||||||
Evaluates statusline string.
|
Evaluates statusline string.
|
||||||
@ -760,6 +762,8 @@ nvim_get_api_info() *nvim_get_api_info()*
|
|||||||
nvim_get_chan_info({chan}) *nvim_get_chan_info()*
|
nvim_get_chan_info({chan}) *nvim_get_chan_info()*
|
||||||
Gets information about a channel.
|
Gets information about a channel.
|
||||||
|
|
||||||
|
See |nvim_list_uis()| for an example of how to get channel info.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
• {chan} channel_id, or 0 for current channel
|
• {chan} channel_id, or 0 for current channel
|
||||||
|
|
||||||
@ -781,7 +785,7 @@ nvim_get_chan_info({chan}) *nvim_get_chan_info()*
|
|||||||
present if a pty is used (e.g. for conpty on Windows).
|
present if a pty is used (e.g. for conpty on Windows).
|
||||||
• "buffer" (optional) Buffer connected to |terminal| instance.
|
• "buffer" (optional) Buffer connected to |terminal| instance.
|
||||||
• "client" (optional) Info about the peer (client on the other end of
|
• "client" (optional) Info about the peer (client on the other end of
|
||||||
the RPC channel), which it provided via |nvim_set_client_info()|.
|
the channel), as set by |nvim_set_client_info()|.
|
||||||
|
|
||||||
nvim_get_color_by_name({name}) *nvim_get_color_by_name()*
|
nvim_get_color_by_name({name}) *nvim_get_color_by_name()*
|
||||||
Returns the 24-bit RGB value of a |nvim_get_color_map()| color name or
|
Returns the 24-bit RGB value of a |nvim_get_color_map()| color name or
|
||||||
@ -1064,6 +1068,12 @@ nvim_list_tabpages() *nvim_list_tabpages()*
|
|||||||
nvim_list_uis() *nvim_list_uis()*
|
nvim_list_uis() *nvim_list_uis()*
|
||||||
Gets a list of dictionaries representing attached UIs.
|
Gets a list of dictionaries representing attached UIs.
|
||||||
|
|
||||||
|
Example: The Nvim builtin |TUI| sets its channel info as described in
|
||||||
|
|startup-tui|. In particular, it sets `client.name` to "nvim-tui". So you
|
||||||
|
can check if the TUI is running by inspecting the client name of each UI: >lua
|
||||||
|
vim.print(vim.api.nvim_get_chan_info(vim.api.nvim_list_uis()[1].chan).client.name)
|
||||||
|
<
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
Array of UI dictionaries, each with these keys:
|
Array of UI dictionaries, each with these keys:
|
||||||
• "height" Requested height of the UI
|
• "height" Requested height of the UI
|
||||||
@ -1112,7 +1122,7 @@ nvim_open_term({buffer}, {opts}) *nvim_open_term()*
|
|||||||
|
|
||||||
Example: this `TermHl` command can be used to display and highlight raw
|
Example: this `TermHl` command can be used to display and highlight raw
|
||||||
ANSI termcodes, so you can use Nvim as a "scrollback pager" (for terminals
|
ANSI termcodes, so you can use Nvim as a "scrollback pager" (for terminals
|
||||||
like kitty): *terminal-scrollback-pager* >lua
|
like kitty): *ansi-colorize* *terminal-scrollback-pager* >lua
|
||||||
vim.api.nvim_create_user_command('TermHl', function()
|
vim.api.nvim_create_user_command('TermHl', function()
|
||||||
local b = vim.api.nvim_create_buf(false, true)
|
local b = vim.api.nvim_create_buf(false, true)
|
||||||
local chan = vim.api.nvim_open_term(b, {})
|
local chan = vim.api.nvim_open_term(b, {})
|
||||||
@ -1237,25 +1247,23 @@ nvim_select_popupmenu_item({item}, {insert}, {finish}, {opts})
|
|||||||
|
|
||||||
*nvim_set_client_info()*
|
*nvim_set_client_info()*
|
||||||
nvim_set_client_info({name}, {version}, {type}, {methods}, {attributes})
|
nvim_set_client_info({name}, {version}, {type}, {methods}, {attributes})
|
||||||
Self-identifies the client.
|
Self-identifies the client. Sets the `client` object returned by
|
||||||
|
|nvim_get_chan_info()|.
|
||||||
|
|
||||||
The client/plugin/application should call this after connecting, to
|
Clients should call this just after connecting, to provide hints for
|
||||||
provide hints about its identity and purpose, for debugging and
|
debugging and orchestration. (Note: Something is better than nothing!
|
||||||
orchestration.
|
Fields are optional, but at least set `name`.)
|
||||||
|
|
||||||
Can be called more than once; the caller should merge old info if
|
Can be called more than once; the caller should merge old info if
|
||||||
appropriate. Example: library first identifies the channel, then a plugin
|
appropriate. Example: library first identifies the channel, then a plugin
|
||||||
using that library later identifies itself.
|
using that library later identifies itself.
|
||||||
|
|
||||||
Note: ~
|
|
||||||
• "Something is better than nothing". You don't need to include all the
|
|
||||||
fields.
|
|
||||||
|
|
||||||
Attributes: ~
|
Attributes: ~
|
||||||
|RPC| only
|
|RPC| only
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
• {name} Short name for the connected client
|
• {name} Client short-name. Sets the `client.name` field of
|
||||||
|
|nvim_get_chan_info()|.
|
||||||
• {version} Dict describing the version, with these (optional) keys:
|
• {version} Dict describing the version, with these (optional) keys:
|
||||||
• "major" major version (defaults to 0 if not set, for
|
• "major" major version (defaults to 0 if not set, for
|
||||||
no release yet)
|
no release yet)
|
||||||
|
@ -21,18 +21,7 @@ To run all healthchecks, use: >vim
|
|||||||
<
|
<
|
||||||
Plugin authors are encouraged to write new healthchecks. |health-dev|
|
Plugin authors are encouraged to write new healthchecks. |health-dev|
|
||||||
|
|
||||||
*g:health*
|
COMMANDS *health-commands*
|
||||||
g:health This global variable controls the behavior and appearance of the
|
|
||||||
`health` floating window. It should be a dictionary containing the
|
|
||||||
following optional keys:
|
|
||||||
- `style`: string? Determines the display style of the `health` window.
|
|
||||||
Set to `'float'` to enable a floating window. Other
|
|
||||||
styles are not currently supported.
|
|
||||||
|
|
||||||
Example: >lua
|
|
||||||
vim.g.health = { style = 'float' }
|
|
||||||
|
|
||||||
Commands *health-commands*
|
|
||||||
|
|
||||||
*:che* *:checkhealth*
|
*:che* *:checkhealth*
|
||||||
:che[ckhealth] Run all healthchecks.
|
:che[ckhealth] Run all healthchecks.
|
||||||
@ -60,6 +49,23 @@ Commands *health-commands*
|
|||||||
:checkhealth vim*
|
:checkhealth vim*
|
||||||
<
|
<
|
||||||
|
|
||||||
|
USAGE *health-usage*
|
||||||
|
|
||||||
|
Local mappings in the healthcheck buffer:
|
||||||
|
|
||||||
|
q Closes the window.
|
||||||
|
|
||||||
|
Global configuration:
|
||||||
|
|
||||||
|
*g:health*
|
||||||
|
g:health Dictionary with the following optional keys:
|
||||||
|
- `style` (`'float'|nil`) Set to "float" to display :checkhealth in
|
||||||
|
a floating window instead of the default behavior.
|
||||||
|
|
||||||
|
Example: >lua
|
||||||
|
vim.g.health = { style = 'float' }
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
Create a healthcheck *health-dev*
|
Create a healthcheck *health-dev*
|
||||||
|
|
||||||
Healthchecks are functions that check the user environment, configuration, or
|
Healthchecks are functions that check the user environment, configuration, or
|
||||||
|
@ -1505,7 +1505,7 @@ vim.wo[{winid}][{bufnr}] *vim.wo*
|
|||||||
Lua module: vim *lua-vim*
|
Lua module: vim *lua-vim*
|
||||||
|
|
||||||
vim.cmd({command}) *vim.cmd()*
|
vim.cmd({command}) *vim.cmd()*
|
||||||
Executes Vim script commands.
|
Executes Vimscript (|Ex-commands|).
|
||||||
|
|
||||||
Note that `vim.cmd` can be indexed with a command name to return a
|
Note that `vim.cmd` can be indexed with a command name to return a
|
||||||
callable function to the command.
|
callable function to the command.
|
||||||
@ -1539,9 +1539,9 @@ vim.cmd({command}) *vim.cmd()*
|
|||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
• {command} (`string|table`) Command(s) to execute. If a string,
|
• {command} (`string|table`) Command(s) to execute. If a string,
|
||||||
executes multiple lines of Vim script at once. In this
|
executes multiple lines of Vimscript at once. In this case,
|
||||||
case, it is an alias to |nvim_exec2()|, where `opts.output`
|
it is an alias to |nvim_exec2()|, where `opts.output` is
|
||||||
is set to false. Thus it works identical to |:source|. If a
|
set to false. Thus it works identical to |:source|. If a
|
||||||
table, executes a single command. In this case, it is an
|
table, executes a single command. In this case, it is an
|
||||||
alias to |nvim_cmd()| where `opts` is empty.
|
alias to |nvim_cmd()| where `opts` is empty.
|
||||||
|
|
||||||
|
@ -221,6 +221,7 @@ DIAGNOSTICS
|
|||||||
|
|
||||||
EDITOR
|
EDITOR
|
||||||
|
|
||||||
|
• Use |yxx| in :help docs to execute Lua and Vimscript code examples.
|
||||||
• Improved |paste| handling for redo (dot-repeat) and macros (|recording|):
|
• Improved |paste| handling for redo (dot-repeat) and macros (|recording|):
|
||||||
• Redoing a large paste is significantly faster and ignores 'autoindent'.
|
• Redoing a large paste is significantly faster and ignores 'autoindent'.
|
||||||
• Replaying a macro with |@| also replays pasted text.
|
• Replaying a macro with |@| also replays pasted text.
|
||||||
@ -276,7 +277,6 @@ LUA
|
|||||||
supporting two new parameters, `encoding` and `strict_indexing`.
|
supporting two new parameters, `encoding` and `strict_indexing`.
|
||||||
• |vim.json.encode()| has an option to enable forward slash escaping
|
• |vim.json.encode()| has an option to enable forward slash escaping
|
||||||
• |vim.fs.abspath()| converts paths to absolute paths.
|
• |vim.fs.abspath()| converts paths to absolute paths.
|
||||||
• Lua and vimscript code examples in docs can now be run using `yxx`.
|
|
||||||
|
|
||||||
OPTIONS
|
OPTIONS
|
||||||
|
|
||||||
@ -362,8 +362,8 @@ UI
|
|||||||
• |vim.diagnostic.setqflist()| updates an existing quickfix list with the
|
• |vim.diagnostic.setqflist()| updates an existing quickfix list with the
|
||||||
given title if found
|
given title if found
|
||||||
• |ui-messages| content chunks now also contain the highlight group ID.
|
• |ui-messages| content chunks now also contain the highlight group ID.
|
||||||
• |:checkhealth| can be display in a floating window and controlled by
|
• |:checkhealth| can display in a floating window, controlled by the
|
||||||
the |g:health| variable.
|
|g:health| variable.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
CHANGED FEATURES *news-changed*
|
CHANGED FEATURES *news-changed*
|
||||||
|
@ -164,8 +164,7 @@ argument.
|
|||||||
you can overwrite a file by adding an exclamation mark to
|
you can overwrite a file by adding an exclamation mark to
|
||||||
the Ex command, as in ":w!". The 'readonly' option can be
|
the Ex command, as in ":w!". The 'readonly' option can be
|
||||||
reset with ":set noro" (see the options chapter, |options|).
|
reset with ":set noro" (see the options chapter, |options|).
|
||||||
Subsequent edits will not be done in readonly mode. Calling
|
Subsequent edits will not be done in readonly mode.
|
||||||
the executable "view" has the same effect as the -R argument.
|
|
||||||
The 'updatecount' option will be set to 10000, meaning that
|
The 'updatecount' option will be set to 10000, meaning that
|
||||||
the swap file will not be updated automatically very often.
|
the swap file will not be updated automatically very often.
|
||||||
See |-M| for disallowing modifications.
|
See |-M| for disallowing modifications.
|
||||||
@ -226,7 +225,8 @@ argument.
|
|||||||
arguments. The {script} name is stored at `_G.arg[0]`.
|
arguments. The {script} name is stored at `_G.arg[0]`.
|
||||||
|
|
||||||
Sets 'verbose' to 1 (like "-V1"), so Lua `print()` writes to
|
Sets 'verbose' to 1 (like "-V1"), so Lua `print()` writes to
|
||||||
output.
|
output, as well as other message-emitting functions like
|
||||||
|
|:echo|.
|
||||||
If {script} prints messages and doesn't cause Nvim to exit,
|
If {script} prints messages and doesn't cause Nvim to exit,
|
||||||
Nvim ensures output ends with a newline.
|
Nvim ensures output ends with a newline.
|
||||||
|
|
||||||
@ -288,21 +288,18 @@ argument.
|
|||||||
command from a script. |debug-mode|
|
command from a script. |debug-mode|
|
||||||
|
|
||||||
*-n*
|
*-n*
|
||||||
-n No |swap-file| will be used. Recovery after a crash will be
|
-n Disables |swap-file| by setting 'updatecount' to 0 (after
|
||||||
impossible. Handy if you want to view or edit a file on a
|
executing any |vimrc|). Recovery after a crash will be
|
||||||
very slow medium (e.g., a floppy).
|
impossible. Improves peformance when working with a file on
|
||||||
Can also be done with ":set updatecount=0". You can switch it
|
a very slow medium (usb drive, network share).
|
||||||
on again by setting the 'updatecount' option to some value,
|
|
||||||
e.g., ":set uc=100".
|
Enable it again by setting 'updatecount' to some value, e.g.
|
||||||
'updatecount' is set to 0 AFTER executing commands from a
|
":set updatecount=100".
|
||||||
vimrc file, but before the GUI initializations. Thus it
|
|
||||||
overrides a setting for 'updatecount' in a vimrc file, but not
|
To reduce accesses to the disk, don't use "-n", but set
|
||||||
in a gvimrc file. See |startup|.
|
'updatetime' and 'updatecount' to very big numbers, and type
|
||||||
When you want to reduce accesses to the disk (e.g., for a
|
":preserve" when you want to save your work. This way you
|
||||||
laptop), don't use "-n", but set 'updatetime' and
|
keep the possibility for crash recovery.
|
||||||
'updatecount' to very big numbers, and type ":preserve" when
|
|
||||||
you want to save your work. This way you keep the possibility
|
|
||||||
for crash recovery.
|
|
||||||
|
|
||||||
*-o*
|
*-o*
|
||||||
-o[N] Open N windows, split horizontally. If [N] is not given,
|
-o[N] Open N windows, split horizontally. If [N] is not given,
|
||||||
|
@ -423,8 +423,11 @@ TUI:
|
|||||||
<
|
<
|
||||||
*'term'* *E529* *E530* *E531*
|
*'term'* *E529* *E530* *E531*
|
||||||
- 'term' reflects the terminal type derived from |$TERM| and other environment
|
- 'term' reflects the terminal type derived from |$TERM| and other environment
|
||||||
checks. For debugging only; not reliable during startup. >vim
|
checks. Use `:echo &term` to get its value. For debugging only; not
|
||||||
:echo &term
|
reliable during startup.
|
||||||
|
- Note: If you want to detect when Nvim is running in a terminal, use
|
||||||
|
`has('gui_running')` |has()| or see |nvim_list_uis()| for an example of
|
||||||
|
how to inspect the UI channel.
|
||||||
- "builtin_x" means one of the |builtin-terms| was chosen, because the expected
|
- "builtin_x" means one of the |builtin-terms| was chosen, because the expected
|
||||||
terminfo file was not found on the system.
|
terminfo file was not found on the system.
|
||||||
- Nvim will use 256-colour capability on Linux virtual terminals. Vim uses
|
- Nvim will use 256-colour capability on Linux virtual terminals. Vim uses
|
||||||
|
@ -391,7 +391,7 @@ end
|
|||||||
|
|
||||||
local VIM_CMD_ARG_MAX = 20
|
local VIM_CMD_ARG_MAX = 20
|
||||||
|
|
||||||
--- Executes Vim script commands.
|
--- Executes Vimscript (|Ex-commands|).
|
||||||
---
|
---
|
||||||
--- Note that `vim.cmd` can be indexed with a command name to return a callable function to the
|
--- Note that `vim.cmd` can be indexed with a command name to return a callable function to the
|
||||||
--- command.
|
--- command.
|
||||||
@ -426,7 +426,7 @@ local VIM_CMD_ARG_MAX = 20
|
|||||||
--- ```
|
--- ```
|
||||||
---
|
---
|
||||||
---@param command string|table Command(s) to execute.
|
---@param command string|table Command(s) to execute.
|
||||||
--- If a string, executes multiple lines of Vim script at once. In this
|
--- If a string, executes multiple lines of Vimscript at once. In this
|
||||||
--- case, it is an alias to |nvim_exec2()|, where `opts.output` is set
|
--- case, it is an alias to |nvim_exec2()|, where `opts.output` is set
|
||||||
--- to false. Thus it works identical to |:source|.
|
--- to false. Thus it works identical to |:source|.
|
||||||
--- If a table, executes a single command. In this case, it is an alias
|
--- If a table, executes a single command. In this case, it is an alias
|
||||||
|
37
runtime/lua/vim/_meta/api.lua
generated
37
runtime/lua/vim/_meta/api.lua
generated
@ -1097,18 +1097,20 @@ function vim.api.nvim_del_user_command(name) end
|
|||||||
--- @param name string Variable name
|
--- @param name string Variable name
|
||||||
function vim.api.nvim_del_var(name) end
|
function vim.api.nvim_del_var(name) end
|
||||||
|
|
||||||
--- Echo a message.
|
--- Prints a message given by a list of `[text, hl_group]` "chunks".
|
||||||
---
|
---
|
||||||
--- @param chunks any[] A list of `[text, hl_group]` arrays, each representing a
|
--- Example:
|
||||||
--- text chunk with specified highlight group name or ID.
|
--- ```lua
|
||||||
--- `hl_group` element can be omitted for no highlight.
|
--- vim.api.nvim_echo({ { 'chunk1-line1\nchunk1-line2\n' }, { 'chunk2-line1' } }, true, {})
|
||||||
|
--- ```
|
||||||
|
---
|
||||||
|
--- @param chunks any[] List of `[text, hl_group]` pairs, where each is a `text` string highlighted by
|
||||||
|
--- the (optional) name or ID `hl_group`.
|
||||||
--- @param history boolean if true, add to `message-history`.
|
--- @param history boolean if true, add to `message-history`.
|
||||||
--- @param opts vim.api.keyset.echo_opts Optional parameters.
|
--- @param opts vim.api.keyset.echo_opts Optional parameters.
|
||||||
--- - err: Treat the message like `:echoerr`. Omitted `hlgroup`
|
--- - err: Treat the message like `:echoerr`. Sets `hl_group` to `hl-ErrorMsg` by default.
|
||||||
--- uses `hl-ErrorMsg` instead.
|
--- - verbose: Message is controlled by the 'verbose' option. Nvim invoked with `-V3log`
|
||||||
--- - verbose: Message is printed as a result of 'verbose' option.
|
--- will write the message to the "log" file instead of standard output.
|
||||||
--- If Nvim was invoked with -V3log_file, the message will be
|
|
||||||
--- redirected to the log_file and suppressed from direct output.
|
|
||||||
function vim.api.nvim_echo(chunks, history, opts) end
|
function vim.api.nvim_echo(chunks, history, opts) end
|
||||||
|
|
||||||
--- @deprecated
|
--- @deprecated
|
||||||
@ -1276,6 +1278,8 @@ function vim.api.nvim_get_autocmds(opts) end
|
|||||||
|
|
||||||
--- Gets information about a channel.
|
--- Gets information about a channel.
|
||||||
---
|
---
|
||||||
|
--- See `nvim_list_uis()` for an example of how to get channel info.
|
||||||
|
---
|
||||||
--- @param chan integer channel_id, or 0 for current channel
|
--- @param chan integer channel_id, or 0 for current channel
|
||||||
--- @return table<string,any> # Channel info dict with these keys:
|
--- @return table<string,any> # Channel info dict with these keys:
|
||||||
--- - "id" Channel id.
|
--- - "id" Channel id.
|
||||||
@ -1293,8 +1297,8 @@ function vim.api.nvim_get_autocmds(opts) end
|
|||||||
--- "/dev/pts/1". If unknown, the key will still be present if a pty is used (e.g.
|
--- "/dev/pts/1". If unknown, the key will still be present if a pty is used (e.g.
|
||||||
--- for conpty on Windows).
|
--- for conpty on Windows).
|
||||||
--- - "buffer" (optional) Buffer connected to |terminal| instance.
|
--- - "buffer" (optional) Buffer connected to |terminal| instance.
|
||||||
--- - "client" (optional) Info about the peer (client on the other end of the RPC channel),
|
--- - "client" (optional) Info about the peer (client on the other end of the channel), as set
|
||||||
--- which it provided via |nvim_set_client_info()|.
|
--- by |nvim_set_client_info()|.
|
||||||
---
|
---
|
||||||
function vim.api.nvim_get_chan_info(chan) end
|
function vim.api.nvim_get_chan_info(chan) end
|
||||||
|
|
||||||
@ -1616,6 +1620,14 @@ function vim.api.nvim_list_tabpages() end
|
|||||||
|
|
||||||
--- Gets a list of dictionaries representing attached UIs.
|
--- Gets a list of dictionaries representing attached UIs.
|
||||||
---
|
---
|
||||||
|
--- Example: The Nvim builtin `TUI` sets its channel info as described in `startup-tui`. In
|
||||||
|
--- particular, it sets `client.name` to "nvim-tui". So you can check if the TUI is running by
|
||||||
|
--- inspecting the client name of each UI:
|
||||||
|
---
|
||||||
|
--- ```lua
|
||||||
|
--- vim.print(vim.api.nvim_get_chan_info(vim.api.nvim_list_uis()[1].chan).client.name)
|
||||||
|
--- ```
|
||||||
|
---
|
||||||
--- @return any[] # Array of UI dictionaries, each with these keys:
|
--- @return any[] # Array of UI dictionaries, each with these keys:
|
||||||
--- - "height" Requested height of the UI
|
--- - "height" Requested height of the UI
|
||||||
--- - "width" Requested width of the UI
|
--- - "width" Requested width of the UI
|
||||||
@ -1661,7 +1673,8 @@ function vim.api.nvim_notify(msg, log_level, opts) end
|
|||||||
--- in a virtual terminal having the intended size.
|
--- in a virtual terminal having the intended size.
|
||||||
---
|
---
|
||||||
--- Example: this `TermHl` command can be used to display and highlight raw ANSI termcodes, so you
|
--- Example: this `TermHl` command can be used to display and highlight raw ANSI termcodes, so you
|
||||||
--- can use Nvim as a "scrollback pager" (for terminals like kitty): [terminal-scrollback-pager]()
|
--- can use Nvim as a "scrollback pager" (for terminals like kitty): [ansi-colorize]()
|
||||||
|
--- [terminal-scrollback-pager]()
|
||||||
---
|
---
|
||||||
--- ```lua
|
--- ```lua
|
||||||
--- vim.api.nvim_create_user_command('TermHl', function()
|
--- vim.api.nvim_create_user_command('TermHl', function()
|
||||||
|
@ -11,18 +11,7 @@
|
|||||||
--- <
|
--- <
|
||||||
--- Plugin authors are encouraged to write new healthchecks. |health-dev|
|
--- Plugin authors are encouraged to write new healthchecks. |health-dev|
|
||||||
---
|
---
|
||||||
--- *g:health*
|
--- COMMANDS *health-commands*
|
||||||
--- g:health This global variable controls the behavior and appearance of the
|
|
||||||
--- `health` floating window. It should be a dictionary containing the
|
|
||||||
--- following optional keys:
|
|
||||||
--- - `style`: string? Determines the display style of the `health` window.
|
|
||||||
--- Set to `'float'` to enable a floating window. Other
|
|
||||||
--- styles are not currently supported.
|
|
||||||
---
|
|
||||||
--- Example: >lua
|
|
||||||
--- vim.g.health = { style = 'float' }
|
|
||||||
---
|
|
||||||
--- Commands *health-commands*
|
|
||||||
---
|
---
|
||||||
--- *:che* *:checkhealth*
|
--- *:che* *:checkhealth*
|
||||||
--- :che[ckhealth] Run all healthchecks.
|
--- :che[ckhealth] Run all healthchecks.
|
||||||
@ -50,6 +39,23 @@
|
|||||||
--- :checkhealth vim*
|
--- :checkhealth vim*
|
||||||
--- <
|
--- <
|
||||||
---
|
---
|
||||||
|
--- USAGE *health-usage*
|
||||||
|
---
|
||||||
|
--- Local mappings in the healthcheck buffer:
|
||||||
|
---
|
||||||
|
--- q Closes the window.
|
||||||
|
---
|
||||||
|
--- Global configuration:
|
||||||
|
---
|
||||||
|
--- *g:health*
|
||||||
|
--- g:health Dictionary with the following optional keys:
|
||||||
|
--- - `style` (`'float'|nil`) Set to "float" to display :checkhealth in
|
||||||
|
--- a floating window instead of the default behavior.
|
||||||
|
---
|
||||||
|
--- Example: >lua
|
||||||
|
--- vim.g.health = { style = 'float' }
|
||||||
|
---
|
||||||
|
--- --------------------------------------------------------------------------------
|
||||||
--- Create a healthcheck *health-dev*
|
--- Create a healthcheck *health-dev*
|
||||||
---
|
---
|
||||||
--- Healthchecks are functions that check the user environment, configuration, or
|
--- Healthchecks are functions that check the user environment, configuration, or
|
||||||
|
@ -879,8 +879,7 @@ function M.make_floating_popup_options(width, height, opts)
|
|||||||
col = col + (opts.offset_x or 0),
|
col = col + (opts.offset_x or 0),
|
||||||
height = height,
|
height = height,
|
||||||
focusable = opts.focusable,
|
focusable = opts.focusable,
|
||||||
relative = opts.relative == 'mouse' and 'mouse'
|
relative = (opts.relative == 'mouse' or opts.relative == 'editor') and opts.relative
|
||||||
or opts.relative == 'editor' and 'editor'
|
|
||||||
or 'cursor',
|
or 'cursor',
|
||||||
style = 'minimal',
|
style = 'minimal',
|
||||||
width = width,
|
width = width,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
-- Updates version.c list of applied Vim patches.
|
-- Updates version.c list of applied Vim patches.
|
||||||
--
|
--
|
||||||
-- Usage:
|
-- Usage:
|
||||||
-- VIM_SOURCE_DIR=~/neovim/.vim-src/ nvim -V1 -es -i NONE +'luafile ./scripts/vimpatch.lua' +q
|
-- VIM_SOURCE_DIR=~/neovim/.vim-src/ nvim -l ./scripts/vimpatch.lua
|
||||||
|
|
||||||
local nvim = vim.api
|
local nvim = vim.api
|
||||||
|
|
||||||
|
@ -766,18 +766,20 @@ void nvim_set_vvar(String name, Object value, Error *err)
|
|||||||
dict_set_var(&vimvardict, name, value, false, false, NULL, err);
|
dict_set_var(&vimvardict, name, value, false, false, NULL, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Echo a message.
|
/// Prints a message given by a list of `[text, hl_group]` "chunks".
|
||||||
///
|
///
|
||||||
/// @param chunks A list of `[text, hl_group]` arrays, each representing a
|
/// Example:
|
||||||
/// text chunk with specified highlight group name or ID.
|
/// ```lua
|
||||||
/// `hl_group` element can be omitted for no highlight.
|
/// vim.api.nvim_echo({ { 'chunk1-line1\nchunk1-line2\n' }, { 'chunk2-line1' } }, true, {})
|
||||||
|
/// ```
|
||||||
|
///
|
||||||
|
/// @param chunks List of `[text, hl_group]` pairs, where each is a `text` string highlighted by
|
||||||
|
/// the (optional) name or ID `hl_group`.
|
||||||
/// @param history if true, add to |message-history|.
|
/// @param history if true, add to |message-history|.
|
||||||
/// @param opts Optional parameters.
|
/// @param opts Optional parameters.
|
||||||
/// - err: Treat the message like |:echoerr|. Omitted `hlgroup`
|
/// - err: Treat the message like `:echoerr`. Sets `hl_group` to |hl-ErrorMsg| by default.
|
||||||
/// uses |hl-ErrorMsg| instead.
|
/// - verbose: Message is controlled by the 'verbose' option. Nvim invoked with `-V3log`
|
||||||
/// - verbose: Message is printed as a result of 'verbose' option.
|
/// will write the message to the "log" file instead of standard output.
|
||||||
/// If Nvim was invoked with -V3log_file, the message will be
|
|
||||||
/// redirected to the log_file and suppressed from direct output.
|
|
||||||
void nvim_echo(Array chunks, Boolean history, Dict(echo_opts) *opts, Error *err)
|
void nvim_echo(Array chunks, Boolean history, Dict(echo_opts) *opts, Error *err)
|
||||||
FUNC_API_SINCE(7)
|
FUNC_API_SINCE(7)
|
||||||
{
|
{
|
||||||
@ -1000,7 +1002,8 @@ Buffer nvim_create_buf(Boolean listed, Boolean scratch, Error *err)
|
|||||||
/// in a virtual terminal having the intended size.
|
/// in a virtual terminal having the intended size.
|
||||||
///
|
///
|
||||||
/// Example: this `TermHl` command can be used to display and highlight raw ANSI termcodes, so you
|
/// Example: this `TermHl` command can be used to display and highlight raw ANSI termcodes, so you
|
||||||
/// can use Nvim as a "scrollback pager" (for terminals like kitty): [terminal-scrollback-pager]()
|
/// can use Nvim as a "scrollback pager" (for terminals like kitty): [ansi-colorize]()
|
||||||
|
/// [terminal-scrollback-pager]()
|
||||||
///
|
///
|
||||||
/// ```lua
|
/// ```lua
|
||||||
/// vim.api.nvim_create_user_command('TermHl', function()
|
/// vim.api.nvim_create_user_command('TermHl', function()
|
||||||
@ -1500,20 +1503,17 @@ Array nvim_get_api_info(uint64_t channel_id, Arena *arena)
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Self-identifies the client.
|
/// Self-identifies the client. Sets the `client` object returned by |nvim_get_chan_info()|.
|
||||||
///
|
///
|
||||||
/// The client/plugin/application should call this after connecting, to provide
|
/// Clients should call this just after connecting, to provide hints for debugging and
|
||||||
/// hints about its identity and purpose, for debugging and orchestration.
|
/// orchestration. (Note: Something is better than nothing! Fields are optional, but at least set
|
||||||
|
/// `name`.)
|
||||||
///
|
///
|
||||||
/// Can be called more than once; the caller should merge old info if
|
/// Can be called more than once; the caller should merge old info if appropriate. Example: library
|
||||||
/// appropriate. Example: library first identifies the channel, then a plugin
|
/// first identifies the channel, then a plugin using that library later identifies itself.
|
||||||
/// using that library later identifies itself.
|
|
||||||
///
|
|
||||||
/// @note "Something is better than nothing". You don't need to include all the
|
|
||||||
/// fields.
|
|
||||||
///
|
///
|
||||||
/// @param channel_id
|
/// @param channel_id
|
||||||
/// @param name Short name for the connected client
|
/// @param name Client short-name. Sets the `client.name` field of |nvim_get_chan_info()|.
|
||||||
/// @param version Dict describing the version, with these
|
/// @param version Dict describing the version, with these
|
||||||
/// (optional) keys:
|
/// (optional) keys:
|
||||||
/// - "major" major version (defaults to 0 if not set, for no release yet)
|
/// - "major" major version (defaults to 0 if not set, for no release yet)
|
||||||
@ -1587,6 +1587,8 @@ void nvim_set_client_info(uint64_t channel_id, String name, Dict version, String
|
|||||||
|
|
||||||
/// Gets information about a channel.
|
/// Gets information about a channel.
|
||||||
///
|
///
|
||||||
|
/// See |nvim_list_uis()| for an example of how to get channel info.
|
||||||
|
///
|
||||||
/// @param chan channel_id, or 0 for current channel
|
/// @param chan channel_id, or 0 for current channel
|
||||||
/// @returns Channel info dict with these keys:
|
/// @returns Channel info dict with these keys:
|
||||||
/// - "id" Channel id.
|
/// - "id" Channel id.
|
||||||
@ -1604,8 +1606,8 @@ void nvim_set_client_info(uint64_t channel_id, String name, Dict version, String
|
|||||||
/// "/dev/pts/1". If unknown, the key will still be present if a pty is used (e.g.
|
/// "/dev/pts/1". If unknown, the key will still be present if a pty is used (e.g.
|
||||||
/// for conpty on Windows).
|
/// for conpty on Windows).
|
||||||
/// - "buffer" (optional) Buffer connected to |terminal| instance.
|
/// - "buffer" (optional) Buffer connected to |terminal| instance.
|
||||||
/// - "client" (optional) Info about the peer (client on the other end of the RPC channel),
|
/// - "client" (optional) Info about the peer (client on the other end of the channel), as set
|
||||||
/// which it provided via |nvim_set_client_info()|.
|
/// by |nvim_set_client_info()|.
|
||||||
///
|
///
|
||||||
Dict nvim_get_chan_info(uint64_t channel_id, Integer chan, Arena *arena, Error *err)
|
Dict nvim_get_chan_info(uint64_t channel_id, Integer chan, Arena *arena, Error *err)
|
||||||
FUNC_API_SINCE(4)
|
FUNC_API_SINCE(4)
|
||||||
@ -1702,6 +1704,14 @@ Dict nvim__stats(Arena *arena)
|
|||||||
|
|
||||||
/// Gets a list of dictionaries representing attached UIs.
|
/// Gets a list of dictionaries representing attached UIs.
|
||||||
///
|
///
|
||||||
|
/// Example: The Nvim builtin |TUI| sets its channel info as described in |startup-tui|. In
|
||||||
|
/// particular, it sets `client.name` to "nvim-tui". So you can check if the TUI is running by
|
||||||
|
/// inspecting the client name of each UI:
|
||||||
|
///
|
||||||
|
/// ```lua
|
||||||
|
/// vim.print(vim.api.nvim_get_chan_info(vim.api.nvim_list_uis()[1].chan).client.name)
|
||||||
|
/// ```
|
||||||
|
///
|
||||||
/// @return Array of UI dictionaries, each with these keys:
|
/// @return Array of UI dictionaries, each with these keys:
|
||||||
/// - "height" Requested height of the UI
|
/// - "height" Requested height of the UI
|
||||||
/// - "width" Requested width of the UI
|
/// - "width" Requested width of the UI
|
||||||
|
@ -340,9 +340,6 @@ describe('vim.fs', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
describe('normalize()', function()
|
describe('normalize()', function()
|
||||||
-- local function vim.fs.normalize(path, opts)
|
|
||||||
-- return exec_lua([[return vim.fs.vim.fs.normalize(...)]], path, opts)
|
|
||||||
-- end
|
|
||||||
it('removes trailing /', function()
|
it('removes trailing /', function()
|
||||||
eq('/home/user', vim.fs.normalize('/home/user/'))
|
eq('/home/user', vim.fs.normalize('/home/user/'))
|
||||||
end)
|
end)
|
||||||
@ -389,7 +386,7 @@ describe('vim.fs', function()
|
|||||||
eq('D:foo/test', vim.fs.normalize('d:foo/test/', win_opts))
|
eq('D:foo/test', vim.fs.normalize('d:foo/test/', win_opts))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('does not change case on paths, see #31833', function()
|
it('always treats paths as case-sensitive #31833', function()
|
||||||
eq('TEST', vim.fs.normalize('TEST', win_opts))
|
eq('TEST', vim.fs.normalize('TEST', win_opts))
|
||||||
eq('test', vim.fs.normalize('test', win_opts))
|
eq('test', vim.fs.normalize('test', win_opts))
|
||||||
eq('C:/FOO/test', vim.fs.normalize('C:/FOO/test', win_opts))
|
eq('C:/FOO/test', vim.fs.normalize('C:/FOO/test', win_opts))
|
||||||
|
@ -3435,7 +3435,6 @@ stack traceback:
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('can discard input', function()
|
it('can discard input', function()
|
||||||
clear()
|
|
||||||
-- discard every other normal 'x' command
|
-- discard every other normal 'x' command
|
||||||
exec_lua [[
|
exec_lua [[
|
||||||
n_key = 0
|
n_key = 0
|
||||||
@ -3461,7 +3460,6 @@ stack traceback:
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('callback invalid return', function()
|
it('callback invalid return', function()
|
||||||
clear()
|
|
||||||
-- second key produces an error which removes the callback
|
-- second key produces an error which removes the callback
|
||||||
exec_lua [[
|
exec_lua [[
|
||||||
n_call = 0
|
n_call = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user