mirror of
https://github.com/neovim/neovim.git
synced 2025-12-17 11:55:34 +00:00
ext_cmdline: documentation
This commit is contained in:
@@ -302,6 +302,8 @@ kind.
|
|||||||
Set the default foreground, background and special colors
|
Set the default foreground, background and special colors
|
||||||
respectively.
|
respectively.
|
||||||
|
|
||||||
|
|
||||||
|
*ui-event-highlight_set*
|
||||||
["highlight_set", attrs]
|
["highlight_set", attrs]
|
||||||
Set the attributes that the next text put on the screen will have.
|
Set the attributes that the next text put on the screen will have.
|
||||||
`attrs` is a dict with the keys below. Any absent key is reset
|
`attrs` is a dict with the keys below. Any absent key is reset
|
||||||
@@ -443,25 +445,57 @@ states might be represented as separate modes.
|
|||||||
tabs: List of Dicts [{ "tab": Tabpage, "name": String }, ...]
|
tabs: List of Dicts [{ "tab": Tabpage, "name": String }, ...]
|
||||||
|
|
||||||
*ui-ext-cmdline*
|
*ui-ext-cmdline*
|
||||||
["cmdline_enter"]
|
["cmdline_show", content, pos, firstc, prompt, indent, level]
|
||||||
Enter the cmdline.
|
content: List of [attrs, string]
|
||||||
|
[[{}, "t"], [attrs, "est"], ...]
|
||||||
|
When cmdline_external is set to true, nvim will not draw the cmdline
|
||||||
|
on the grid, instead nvim will send ui events of the cmdline content
|
||||||
|
and cursor position to the remote ui. The `content` is the full content
|
||||||
|
that should be displayed in the cmdline, and the `pos` is the position
|
||||||
|
of the cursor that in the cmdline. This event will be triggered when
|
||||||
|
you type in the cmdline. The content is divided into chunks with
|
||||||
|
different highlight attributes represented as a dict, see
|
||||||
|
|ui-event-highlight_set|.
|
||||||
|
|
||||||
|
`firstc` and `prompt` are text, that if non-empty should be
|
||||||
|
displayed in front of the command line. `firstc` always indicates
|
||||||
|
built in command lines such as `:` (ex command) and `/` `?` (search),
|
||||||
|
while `prompt` is an |input()| prompt. `indent` tells how many spaces
|
||||||
|
the content should be indented
|
||||||
|
|
||||||
|
The command line in nvim can be invoked recursively, for instance by
|
||||||
|
typing `<c-r>=` at the command line prompt. The `level` field is used
|
||||||
|
to distinguish different command lines active at the same time. The
|
||||||
|
first invoked command line will always have level 1, and the next
|
||||||
|
recursively invoked prompt will have level 2. Also, a command line
|
||||||
|
invoked while in command line window will have a higher level than
|
||||||
|
than the edited command line.
|
||||||
|
|
||||||
|
["cmdline_pos", pos, level]
|
||||||
|
Change the cursor position in the cmdline.
|
||||||
|
|
||||||
|
["cmdline_special_char", c, shift, level]
|
||||||
|
Display a special char in the cmdline at the cursor position. This is
|
||||||
|
typically used to indicate a pending state, like right after Ctrl-V.
|
||||||
|
if shift is true the text after the cursor should be shifted,
|
||||||
|
otherwise it should overshadow the char at the cursor.
|
||||||
|
Should be hidden at next cmdline_char
|
||||||
|
|
||||||
|
|
||||||
["cmdline_hide"]
|
["cmdline_hide"]
|
||||||
Hide the cmdline.
|
Hide the cmdline.
|
||||||
|
|
||||||
["cmdline_show", content, pos, firstc, prompt]
|
["cmdline_block_show", lines]
|
||||||
content: List of [highlight group, string]
|
Show a block of context to the current command line. This occurs for
|
||||||
[["Normal", "t"], ["Search", "est"], ...]
|
instance if a function is interactively defined at the command line.
|
||||||
When cmdline_external is set to true, nvim will not draw the cmdline
|
`lines` is a list of lines where each line is represented as a list of
|
||||||
on the grad, instead nvim will send ui events of the cmdline content
|
highlighted chunks, just like `contents` of |ui-event-cmdline_show|.
|
||||||
and cursor position to the remote ui. The content is the full content
|
|
||||||
that should be displayed in the cmdline, and the pos is the position
|
|
||||||
of the cursor that in the cmdline. This event will be triggered when
|
|
||||||
you type in the cmdline.
|
|
||||||
|
|
||||||
["cmdline_pos", pos]
|
["cmdline_block_append", line]
|
||||||
When you move your cursor, nvim will send out this event which tells
|
Append a line at the end of the currently shown block.
|
||||||
you the current position of the cursor in the cmdline.
|
|
||||||
|
["cmdline_block_hide"]
|
||||||
|
Hide the block.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||||
|
|||||||
Reference in New Issue
Block a user