mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 19:38:20 +00:00
fix(docs): invalid :help links #20345
Fix those naughty single quotes. closes #20159
This commit is contained in:
@@ -345,7 +345,7 @@ LUA ~
|
|||||||
In-process Lua plugins can receive buffer updates in the form of Lua
|
In-process Lua plugins can receive buffer updates in the form of Lua
|
||||||
callbacks. These callbacks are called frequently in various contexts;
|
callbacks. These callbacks are called frequently in various contexts;
|
||||||
|textlock| prevents changing buffer contents and window layout (use
|
|textlock| prevents changing buffer contents and window layout (use
|
||||||
|vim.schedule| to defer such operations to the main loop instead).
|
|vim.schedule()| to defer such operations to the main loop instead).
|
||||||
|
|
||||||
|nvim_buf_attach()| will take keyword args for the callbacks. "on_lines" will
|
|nvim_buf_attach()| will take keyword args for the callbacks. "on_lines" will
|
||||||
receive parameters ("lines", {buf}, {changedtick}, {firstline}, {lastline},
|
receive parameters ("lines", {buf}, {changedtick}, {firstline}, {lastline},
|
||||||
@@ -989,7 +989,7 @@ nvim_get_proc_children({pid}) *nvim_get_proc_children()*
|
|||||||
nvim_get_runtime_file({name}, {all}) *nvim_get_runtime_file()*
|
nvim_get_runtime_file({name}, {all}) *nvim_get_runtime_file()*
|
||||||
Find files in runtime directories
|
Find files in runtime directories
|
||||||
|
|
||||||
'name' can contain wildcards. For example
|
"name" can contain wildcards. For example
|
||||||
nvim_get_runtime_file("colors/*.vim", true) will return all color scheme
|
nvim_get_runtime_file("colors/*.vim", true) will return all color scheme
|
||||||
files. Always use forward slashes (/) in the search pattern for
|
files. Always use forward slashes (/) in the search pattern for
|
||||||
subdirectories regardless of platform.
|
subdirectories regardless of platform.
|
||||||
@@ -1164,7 +1164,7 @@ nvim_open_term({buffer}, {opts}) *nvim_open_term()*
|
|||||||
terminal mode. Note: keypresses are sent raw as they would
|
terminal mode. Note: keypresses are sent raw as they would
|
||||||
be to the pty master end. For instance, a carriage return
|
be to the pty master end. For instance, a carriage return
|
||||||
is sent as a "\r", not as a "\n". |textlock| applies. It
|
is sent as a "\r", not as a "\n". |textlock| applies. It
|
||||||
is possible to call |nvim_chan_send| directly in the
|
is possible to call |nvim_chan_send()| directly in the
|
||||||
callback however. ["input", term, bufnr, data]
|
callback however. ["input", term, bufnr, data]
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
@@ -1396,15 +1396,15 @@ nvim_set_hl({ns_id}, {name}, {*val}) *nvim_set_hl()*
|
|||||||
• link: name of another highlight group to link to, see
|
• link: name of another highlight group to link to, see
|
||||||
|:hi-link|.
|
|:hi-link|.
|
||||||
• default: Don't override existing definition |:hi-default|
|
• default: Don't override existing definition |:hi-default|
|
||||||
• ctermfg: Sets foreground of cterm color |highlight-ctermfg|
|
• ctermfg: Sets foreground of cterm color |ctermfg|
|
||||||
• ctermbg: Sets background of cterm color |highlight-ctermbg|
|
• ctermbg: Sets background of cterm color |ctermbg|
|
||||||
• cterm: cterm attribute map, like |highlight-args|. If not
|
• cterm: cterm attribute map, like |highlight-args|. If not
|
||||||
set, cterm attributes will match those from the attribute
|
set, cterm attributes will match those from the attribute
|
||||||
map documented above.
|
map documented above.
|
||||||
|
|
||||||
nvim_set_hl_ns({ns_id}) *nvim_set_hl_ns()*
|
nvim_set_hl_ns({ns_id}) *nvim_set_hl_ns()*
|
||||||
Set active namespace for highlights. This can be set for a single window,
|
Set active namespace for highlights. This can be set for a single window,
|
||||||
see |nvim_win_set_hl_ns|.
|
see |nvim_win_set_hl_ns()|.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{ns_id} the namespace to use
|
{ns_id} the namespace to use
|
||||||
@@ -1413,7 +1413,7 @@ nvim_set_hl_ns_fast({ns_id}) *nvim_set_hl_ns_fast()*
|
|||||||
Set active namespace for highlights while redrawing.
|
Set active namespace for highlights while redrawing.
|
||||||
|
|
||||||
This function meant to be called while redrawing, primarily from
|
This function meant to be called while redrawing, primarily from
|
||||||
|nvim_set_decoration_provider| on_win and on_line callbacks, which are
|
|nvim_set_decoration_provider()| on_win and on_line callbacks, which are
|
||||||
allowed to change the namespace during a redraw cycle.
|
allowed to change the namespace during a redraw cycle.
|
||||||
|
|
||||||
Attributes: ~
|
Attributes: ~
|
||||||
@@ -1445,7 +1445,7 @@ nvim_set_keymap({mode}, {lhs}, {rhs}, {*opts}) *nvim_set_keymap()*
|
|||||||
{rhs} Right-hand-side |{rhs}| of the mapping.
|
{rhs} Right-hand-side |{rhs}| of the mapping.
|
||||||
{opts} Optional parameters map: keys are |:map-arguments|, values are
|
{opts} Optional parameters map: keys are |:map-arguments|, values are
|
||||||
booleans (default false). Accepts all |:map-arguments| as keys
|
booleans (default false). Accepts all |:map-arguments| as keys
|
||||||
excluding |<buffer>| but including |noremap| and "desc".
|
excluding |<buffer>| but including |:noremap| and "desc".
|
||||||
Unknown key is an error. "desc" can be used to give a
|
Unknown key is an error. "desc" can be used to give a
|
||||||
description to the mapping. When called from Lua, also accepts
|
description to the mapping. When called from Lua, also accepts
|
||||||
a "callback" key that takes a Lua function to call when the
|
a "callback" key that takes a Lua function to call when the
|
||||||
@@ -1886,7 +1886,7 @@ nvim_get_all_options_info() *nvim_get_all_options_info()*
|
|||||||
Gets the option information for all options.
|
Gets the option information for all options.
|
||||||
|
|
||||||
The dictionary has the full option names as keys and option metadata
|
The dictionary has the full option names as keys and option metadata
|
||||||
dictionaries as detailed at |nvim_get_option_info|.
|
dictionaries as detailed at |nvim_get_option_info()|.
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
dictionary of all options
|
dictionary of all options
|
||||||
@@ -1960,7 +1960,7 @@ nvim_set_option_value({name}, {value}, {*opts})
|
|||||||
{name} Option name
|
{name} Option name
|
||||||
{value} New option value
|
{value} New option value
|
||||||
{opts} Optional parameters
|
{opts} Optional parameters
|
||||||
• scope: One of 'global' or 'local'. Analogous to
|
• scope: One of "global" or "local". Analogous to
|
||||||
|:setglobal| and |:setlocal|, respectively.
|
|:setglobal| and |:setlocal|, respectively.
|
||||||
• win: |window-ID|. Used for setting window local option.
|
• win: |window-ID|. Used for setting window local option.
|
||||||
• buf: Buffer number. Used for setting buffer local option.
|
• buf: Buffer number. Used for setting buffer local option.
|
||||||
@@ -2576,7 +2576,7 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {*opts})
|
|||||||
highlight groups that will be stacked (highest priority
|
highlight groups that will be stacked (highest priority
|
||||||
last). A highlight group can be supplied either as a
|
last). A highlight group can be supplied either as a
|
||||||
string or as an integer, the latter which can be obtained
|
string or as an integer, the latter which can be obtained
|
||||||
using |nvim_get_hl_id_by_name|.
|
using |nvim_get_hl_id_by_name()|.
|
||||||
• virt_text_pos : position of virtual text. Possible values:
|
• virt_text_pos : position of virtual text. Possible values:
|
||||||
• "eol": right after eol character (default)
|
• "eol": right after eol character (default)
|
||||||
• "overlay": display over the specified column, without
|
• "overlay": display over the specified column, without
|
||||||
@@ -2608,7 +2608,7 @@ nvim_buf_set_extmark({buffer}, {ns_id}, {line}, {col}, {*opts})
|
|||||||
• virt_lines_above: place virtual lines above instead.
|
• virt_lines_above: place virtual lines above instead.
|
||||||
• virt_lines_leftcol: Place extmarks in the leftmost column
|
• virt_lines_leftcol: Place extmarks in the leftmost column
|
||||||
of the window, bypassing sign and number columns.
|
of the window, bypassing sign and number columns.
|
||||||
• ephemeral : for use with |nvim_set_decoration_provider|
|
• ephemeral : for use with |nvim_set_decoration_provider()|
|
||||||
callbacks. The mark will only be used for the current
|
callbacks. The mark will only be used for the current
|
||||||
redraw cycle, and not be permantently stored in the
|
redraw cycle, and not be permantently stored in the
|
||||||
buffer.
|
buffer.
|
||||||
@@ -2686,7 +2686,7 @@ nvim_set_decoration_provider({ns_id}, {*opts})
|
|||||||
triggered during the redraw code.
|
triggered during the redraw code.
|
||||||
|
|
||||||
The expected usage is to set extmarks for the currently redrawn buffer.
|
The expected usage is to set extmarks for the currently redrawn buffer.
|
||||||
|nvim_buf_set_extmark| can be called to add marks on a per-window or
|
|nvim_buf_set_extmark()| can be called to add marks on a per-window or
|
||||||
per-lines basis. Use the `ephemeral` key to only use the mark for the
|
per-lines basis. Use the `ephemeral` key to only use the mark for the
|
||||||
current screen redraw (the callback will be called again for the next
|
current screen redraw (the callback will be called again for the next
|
||||||
redraw ).
|
redraw ).
|
||||||
@@ -2844,7 +2844,7 @@ nvim_win_hide({window}) *nvim_win_hide()*
|
|||||||
|
|
||||||
Like |:hide| the buffer becomes hidden unless another window is editing
|
Like |:hide| the buffer becomes hidden unless another window is editing
|
||||||
it, or 'bufhidden' is `unload`, `delete` or `wipe` as opposed to |:close|
|
it, or 'bufhidden' is `unload`, `delete` or `wipe` as opposed to |:close|
|
||||||
or |nvim_win_close|, which will close the buffer.
|
or |nvim_win_close()|, which will close the buffer.
|
||||||
|
|
||||||
Attributes: ~
|
Attributes: ~
|
||||||
not allowed when |textlock| is active
|
not allowed when |textlock| is active
|
||||||
@@ -3012,7 +3012,7 @@ nvim_open_win({buffer}, {enter}, {*config}) *nvim_open_win()*
|
|||||||
options. 'signcolumn' is changed to `auto` and
|
options. 'signcolumn' is changed to `auto` and
|
||||||
'colorcolumn' is cleared. The end-of-buffer region is
|
'colorcolumn' is cleared. The end-of-buffer region is
|
||||||
hidden by setting `eob` flag of 'fillchars' to a space
|
hidden by setting `eob` flag of 'fillchars' to a space
|
||||||
char, and clearing the |EndOfBuffer| region in
|
char, and clearing the |hl-EndOfBuffer| region in
|
||||||
'winhighlight'.
|
'winhighlight'.
|
||||||
|
|
||||||
• border: Style of (optional) window border. This can either
|
• border: Style of (optional) window border. This can either
|
||||||
@@ -3148,7 +3148,7 @@ Autocmd Functions *api-autocmd*
|
|||||||
|
|
||||||
nvim_clear_autocmds({*opts}) *nvim_clear_autocmds()*
|
nvim_clear_autocmds({*opts}) *nvim_clear_autocmds()*
|
||||||
Clear all autocommands that match the corresponding {opts}. To delete a
|
Clear all autocommands that match the corresponding {opts}. To delete a
|
||||||
particular autocmd, see |nvim_del_autocmd|.
|
particular autocmd, see |nvim_del_autocmd()|.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{opts} Parameters
|
{opts} Parameters
|
||||||
@@ -3295,7 +3295,7 @@ nvim_del_augroup_by_id({id}) *nvim_del_augroup_by_id()*
|
|||||||
|
|
||||||
To get a group id one can use |nvim_get_autocmds()|.
|
To get a group id one can use |nvim_get_autocmds()|.
|
||||||
|
|
||||||
NOTE: behavior differs from |augroup-delete|. When deleting a group,
|
NOTE: behavior differs from |:augroup-delete|. When deleting a group,
|
||||||
autocommands contained in this group will also be deleted and cleared.
|
autocommands contained in this group will also be deleted and cleared.
|
||||||
This group will no longer exist.
|
This group will no longer exist.
|
||||||
|
|
||||||
@@ -3309,7 +3309,7 @@ nvim_del_augroup_by_id({id}) *nvim_del_augroup_by_id()*
|
|||||||
nvim_del_augroup_by_name({name}) *nvim_del_augroup_by_name()*
|
nvim_del_augroup_by_name({name}) *nvim_del_augroup_by_name()*
|
||||||
Delete an autocommand group by name.
|
Delete an autocommand group by name.
|
||||||
|
|
||||||
NOTE: behavior differs from |augroup-delete|. When deleting a group,
|
NOTE: behavior differs from |:augroup-delete|. When deleting a group,
|
||||||
autocommands contained in this group will also be deleted and cleared.
|
autocommands contained in this group will also be deleted and cleared.
|
||||||
This group will no longer exist.
|
This group will no longer exist.
|
||||||
|
|
||||||
@@ -3317,7 +3317,7 @@ nvim_del_augroup_by_name({name}) *nvim_del_augroup_by_name()*
|
|||||||
{name} String The name of the group.
|
{name} String The name of the group.
|
||||||
|
|
||||||
See also: ~
|
See also: ~
|
||||||
|autocommand-groups|
|
|autocmd-groups|
|
||||||
|
|
||||||
nvim_del_autocmd({id}) *nvim_del_autocmd()*
|
nvim_del_autocmd({id}) *nvim_del_autocmd()*
|
||||||
Delete an autocommand by id.
|
Delete an autocommand by id.
|
||||||
|
@@ -835,13 +835,13 @@ QuitPre When using `:quit`, `:wq` or `:qall`, before
|
|||||||
See also |ExitPre|, |WinClosed|.
|
See also |ExitPre|, |WinClosed|.
|
||||||
*RemoteReply*
|
*RemoteReply*
|
||||||
RemoteReply When a reply from a Vim that functions as
|
RemoteReply When a reply from a Vim that functions as
|
||||||
server was received |server2client()|. The
|
server was received server2client(). The
|
||||||
pattern is matched against the {serverid}.
|
pattern is matched against the {serverid}.
|
||||||
<amatch> is equal to the {serverid} from which
|
<amatch> is equal to the {serverid} from which
|
||||||
the reply was sent, and <afile> is the actual
|
the reply was sent, and <afile> is the actual
|
||||||
reply string.
|
reply string.
|
||||||
Note that even if an autocommand is defined,
|
Note that even if an autocommand is defined,
|
||||||
the reply should be read with |remote_read()|
|
the reply should be read with remote_read()
|
||||||
to consume it.
|
to consume it.
|
||||||
*SearchWrapped*
|
*SearchWrapped*
|
||||||
SearchWrapped After making a search with |n| or |N| if the
|
SearchWrapped After making a search with |n| or |N| if the
|
||||||
@@ -1206,7 +1206,7 @@ still executed.
|
|||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
7. Buffer-local autocommands *autocmd-buflocal* *autocmd-buffer-local*
|
7. Buffer-local autocommands *autocmd-buflocal* *autocmd-buffer-local*
|
||||||
*<buffer=N>* *<buffer=abuf>* *E680*
|
*<buffer>* *<buffer=N>* *<buffer=abuf>* *E680*
|
||||||
|
|
||||||
Buffer-local autocommands are attached to a specific buffer. They are useful
|
Buffer-local autocommands are attached to a specific buffer. They are useful
|
||||||
if the buffer does not have a name and when the name does not match a specific
|
if the buffer does not have a name and when the name does not match a specific
|
||||||
|
@@ -1537,7 +1537,7 @@ cursor({list})
|
|||||||
debugbreak({pid}) *debugbreak()*
|
debugbreak({pid}) *debugbreak()*
|
||||||
Specifically used to interrupt a program being debugged. It
|
Specifically used to interrupt a program being debugged. It
|
||||||
will cause process {pid} to get a SIGTRAP. Behavior for other
|
will cause process {pid} to get a SIGTRAP. Behavior for other
|
||||||
processes is undefined. See |terminal-debugger|.
|
processes is undefined. See |terminal-debug|.
|
||||||
{Sends a SIGINT to a process {pid} other than MS-Windows}
|
{Sends a SIGINT to a process {pid} other than MS-Windows}
|
||||||
|
|
||||||
Returns |TRUE| if successfully interrupted the program.
|
Returns |TRUE| if successfully interrupted the program.
|
||||||
@@ -3289,18 +3289,18 @@ getmatches([{win}]) *getmatches()*
|
|||||||
an empty list is returned.
|
an empty list is returned.
|
||||||
Example: >
|
Example: >
|
||||||
:echo getmatches()
|
:echo getmatches()
|
||||||
< [{'group': 'MyGroup1', 'pattern': 'TODO',
|
< [{"group": "MyGroup1", "pattern": "TODO",
|
||||||
'priority': 10, 'id': 1}, {'group': 'MyGroup2',
|
"priority": 10, "id": 1}, {"group": "MyGroup2",
|
||||||
'pattern': 'FIXME', 'priority': 10, 'id': 2}] >
|
"pattern": "FIXME", "priority": 10, "id": 2}] >
|
||||||
:let m = getmatches()
|
:let m = getmatches()
|
||||||
:call clearmatches()
|
:call clearmatches()
|
||||||
:echo getmatches()
|
:echo getmatches()
|
||||||
< [] >
|
< [] >
|
||||||
:call setmatches(m)
|
:call setmatches(m)
|
||||||
:echo getmatches()
|
:echo getmatches()
|
||||||
< [{'group': 'MyGroup1', 'pattern': 'TODO',
|
< [{"group": "MyGroup1", "pattern": "TODO",
|
||||||
'priority': 10, 'id': 1}, {'group': 'MyGroup2',
|
"priority": 10, "id": 1}, {"group": "MyGroup2",
|
||||||
'pattern': 'FIXME', 'priority': 10, 'id': 2}] >
|
"pattern": "FIXME", "priority": 10, "id": 2}] >
|
||||||
:unlet m
|
:unlet m
|
||||||
<
|
<
|
||||||
getmousepos() *getmousepos()*
|
getmousepos() *getmousepos()*
|
||||||
@@ -3499,7 +3499,7 @@ getreginfo([{regname}]) *getreginfo()*
|
|||||||
Dictionary with the following entries:
|
Dictionary with the following entries:
|
||||||
regcontents List of lines contained in register
|
regcontents List of lines contained in register
|
||||||
{regname}, like
|
{regname}, like
|
||||||
|getreg|({regname}, 1, 1).
|
getreg({regname}, 1, 1).
|
||||||
regtype the type of register {regname}, as in
|
regtype the type of register {regname}, as in
|
||||||
|getregtype()|.
|
|getregtype()|.
|
||||||
isunnamed Boolean flag, v:true if this register
|
isunnamed Boolean flag, v:true if this register
|
||||||
@@ -4415,7 +4415,7 @@ jobstart({cmd} [, {opts}]) *jobstart()*
|
|||||||
killed when Nvim exits. If the process exits
|
killed when Nvim exits. If the process exits
|
||||||
before Nvim, `on_exit` will be invoked.
|
before Nvim, `on_exit` will be invoked.
|
||||||
env: (dict) Map of environment variable name:value
|
env: (dict) Map of environment variable name:value
|
||||||
pairs extending (or replacing with |clear_env|)
|
pairs extending (or replace with "clear_env")
|
||||||
the current environment. |jobstart-env|
|
the current environment. |jobstart-env|
|
||||||
height: (number) Height of the `pty` terminal.
|
height: (number) Height of the `pty` terminal.
|
||||||
|on_exit|: (function) Callback invoked when the job exits.
|
|on_exit|: (function) Callback invoked when the job exits.
|
||||||
@@ -5209,12 +5209,12 @@ matchfuzzypos({list}, {str} [, {dict}]) *matchfuzzypos()*
|
|||||||
|
|
||||||
Example: >
|
Example: >
|
||||||
:echo matchfuzzypos(['testing'], 'tsg')
|
:echo matchfuzzypos(['testing'], 'tsg')
|
||||||
< results in [['testing'], [[0, 2, 6]], [99]] >
|
< results in [["testing"], [[0, 2, 6]], [99]] >
|
||||||
:echo matchfuzzypos(['clay', 'lacy'], 'la')
|
:echo matchfuzzypos(['clay', 'lacy'], 'la')
|
||||||
< results in [['lacy', 'clay'], [[0, 1], [1, 2]], [153, 133]] >
|
< results in [["lacy", "clay"], [[0, 1], [1, 2]], [153, 133]] >
|
||||||
:echo [{'text': 'hello', 'id' : 10}]
|
:echo [{'text': 'hello', 'id' : 10}]
|
||||||
\ ->matchfuzzypos('ll', {'key' : 'text'})
|
\ ->matchfuzzypos('ll', {'key' : 'text'})
|
||||||
< results in [[{'id': 10, 'text': 'hello'}], [[2, 3]], [127]]
|
< results in [[{"id": 10, "text": "hello"}], [[2, 3]], [127]]
|
||||||
|
|
||||||
matchlist({expr}, {pat} [, {start} [, {count}]]) *matchlist()*
|
matchlist({expr}, {pat} [, {start} [, {count}]]) *matchlist()*
|
||||||
Same as |match()|, but return a |List|. The first item in the
|
Same as |match()|, but return a |List|. The first item in the
|
||||||
@@ -8247,7 +8247,7 @@ synIDattr({synID}, {what} [, {mode}]) *synIDattr()*
|
|||||||
"bg" background color (as with "fg")
|
"bg" background color (as with "fg")
|
||||||
"font" font name (only available in the GUI)
|
"font" font name (only available in the GUI)
|
||||||
|highlight-font|
|
|highlight-font|
|
||||||
"sp" special color (as with "fg") |highlight-guisp|
|
"sp" special color (as with "fg") |guisp|
|
||||||
"fg#" like "fg", but for the GUI and the GUI is
|
"fg#" like "fg", but for the GUI and the GUI is
|
||||||
running the name in "#RRGGBB" form
|
running the name in "#RRGGBB" form
|
||||||
"bg#" like "fg#" for "bg"
|
"bg#" like "fg#" for "bg"
|
||||||
@@ -9106,12 +9106,12 @@ winlayout([{tabnr}]) *winlayout()*
|
|||||||
returns an empty list.
|
returns an empty list.
|
||||||
|
|
||||||
For a leaf window, it returns:
|
For a leaf window, it returns:
|
||||||
['leaf', {winid}]
|
["leaf", {winid}]
|
||||||
For horizontally split windows, which form a column, it
|
For horizontally split windows, which form a column, it
|
||||||
returns:
|
returns:
|
||||||
['col', [{nested list of windows}]]
|
["col", [{nested list of windows}]]
|
||||||
For vertically split windows, which form a row, it returns:
|
For vertically split windows, which form a row, it returns:
|
||||||
['row', [{nested list of windows}]]
|
["row", [{nested list of windows}]]
|
||||||
|
|
||||||
Example: >
|
Example: >
|
||||||
" Only one window in the tab page
|
" Only one window in the tab page
|
||||||
|
@@ -764,7 +764,7 @@ Count and Range *N:*
|
|||||||
|
|
||||||
When giving a count before entering ":", this is translated into:
|
When giving a count before entering ":", this is translated into:
|
||||||
:.,.+(count - 1)
|
:.,.+(count - 1)
|
||||||
In words: The 'count' lines at and after the cursor. Example: To delete
|
In words: The "count" lines at and after the cursor. Example: To delete
|
||||||
three lines: >
|
three lines: >
|
||||||
3:d<CR> is translated into: .,.+2d<CR>
|
3:d<CR> is translated into: .,.+2d<CR>
|
||||||
<
|
<
|
||||||
|
@@ -288,7 +288,7 @@ g:ada_rainbow_color bool (true when exists)
|
|||||||
rainbow_parenthesis for this to work.
|
rainbow_parenthesis for this to work.
|
||||||
|
|
||||||
*g:ada_folding*
|
*g:ada_folding*
|
||||||
g:ada_folding set ('sigpft')
|
g:ada_folding set ("sigpft")
|
||||||
Use folding for Ada sources.
|
Use folding for Ada sources.
|
||||||
's': activate syntax folding on load
|
's': activate syntax folding on load
|
||||||
'p': fold packages
|
'p': fold packages
|
||||||
@@ -296,10 +296,10 @@ g:ada_folding set ('sigpft')
|
|||||||
't': fold types
|
't': fold types
|
||||||
'c': fold conditionals
|
'c': fold conditionals
|
||||||
'g': activate gnat pretty print folding on load
|
'g': activate gnat pretty print folding on load
|
||||||
'i': lone 'is' folded with line above
|
'i': lone "is" folded with line above
|
||||||
'b': lone 'begin' folded with line above
|
'b': lone "begin" folded with line above
|
||||||
'p': lone 'private' folded with line above
|
'p': lone "private" folded with line above
|
||||||
'x': lone 'exception' folded with line above
|
'x': lone "exception" folded with line above
|
||||||
'i': activate indent folding on load
|
'i': activate indent folding on load
|
||||||
|
|
||||||
Note: Syntax folding is in an early (unusable) stage and
|
Note: Syntax folding is in an early (unusable) stage and
|
||||||
@@ -334,10 +334,10 @@ g:ada_omni_with_keywords
|
|||||||
completion (|i_CTRL-X_CTRL-U|).
|
completion (|i_CTRL-X_CTRL-U|).
|
||||||
|
|
||||||
*g:ada_extended_tagging*
|
*g:ada_extended_tagging*
|
||||||
g:ada_extended_tagging enum ('jump', 'list')
|
g:ada_extended_tagging enum ("jump", "list")
|
||||||
use extended tagging, two options are available
|
use extended tagging, two options are available
|
||||||
'jump': use tjump to jump.
|
"jump": use tjump to jump.
|
||||||
'list': add tags quick fix list.
|
"list": add tags quick fix list.
|
||||||
Normal tagging does not support function or operator
|
Normal tagging does not support function or operator
|
||||||
overloading as these features are not available in C and
|
overloading as these features are not available in C and
|
||||||
tagging was originally developed for C.
|
tagging was originally developed for C.
|
||||||
@@ -359,8 +359,8 @@ g:ada_with_gnat_project_files bool (true when exists)
|
|||||||
|
|
||||||
*g:ada_default_compiler*
|
*g:ada_default_compiler*
|
||||||
g:ada_default_compiler string
|
g:ada_default_compiler string
|
||||||
set default compiler. Currently supported are 'gnat' and
|
set default compiler. Currently supported are "gnat" and
|
||||||
'decada'.
|
"decada".
|
||||||
|
|
||||||
An "exists" type is a boolean considered true when the variable is defined and
|
An "exists" type is a boolean considered true when the variable is defined and
|
||||||
false when the variable is undefined. The value to which the variable is set
|
false when the variable is undefined. The value to which the variable is set
|
||||||
@@ -406,14 +406,14 @@ makes no difference.
|
|||||||
g:gnat object
|
g:gnat object
|
||||||
Control object which manages GNAT compiles. The object
|
Control object which manages GNAT compiles. The object
|
||||||
is created when the first Ada source code is loaded provided
|
is created when the first Ada source code is loaded provided
|
||||||
that |g:ada_default_compiler| is set to 'gnat'. See
|
that |g:ada_default_compiler| is set to "gnat". See
|
||||||
|gnat_members| for details.
|
|gnat_members| for details.
|
||||||
|
|
||||||
*g:decada*
|
*g:decada*
|
||||||
g:decada object
|
g:decada object
|
||||||
Control object which manages Dec Ada compiles. The object
|
Control object which manages Dec Ada compiles. The object
|
||||||
is created when the first Ada source code is loaded provided
|
is created when the first Ada source code is loaded provided
|
||||||
that |g:ada_default_compiler| is set to 'decada'. See
|
that |g:ada_default_compiler| is set to "decada". See
|
||||||
|decada_members| for details.
|
|decada_members| for details.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
@@ -459,11 +459,11 @@ ada#List_Tag([{line}, {col}]) *ada#Listtags()*
|
|||||||
ada#Jump_Tag ({ident}, {mode}) *ada#Jump_Tag()*
|
ada#Jump_Tag ({ident}, {mode}) *ada#Jump_Tag()*
|
||||||
List all occurrences of the Ada entity under the cursor (or at
|
List all occurrences of the Ada entity under the cursor (or at
|
||||||
given line/column) in the tag jump list. Mode can either be
|
given line/column) in the tag jump list. Mode can either be
|
||||||
'tjump' or 'stjump'.
|
"tjump" or "stjump".
|
||||||
|
|
||||||
ada#Create_Tags ({option}) *ada#Create_Tags()*
|
ada#Create_Tags ({option}) *ada#Create_Tags()*
|
||||||
Creates tag file using Ctags. The option can either be 'file'
|
Creates tag file using Ctags. The option can either be "file"
|
||||||
for the current file, 'dir' for the directory of the current
|
for the current file, "dir" for the directory of the current
|
||||||
file or a file name.
|
file or a file name.
|
||||||
|
|
||||||
gnat#Insert_Tags_Header() *gnat#Insert_Tags_Header()*
|
gnat#Insert_Tags_Header() *gnat#Insert_Tags_Header()*
|
||||||
|
@@ -92,8 +92,8 @@ g:ftplugin_rust_source_path~
|
|||||||
|
|
||||||
*g:rustfmt_command*
|
*g:rustfmt_command*
|
||||||
g:rustfmt_command~
|
g:rustfmt_command~
|
||||||
Set this option to the name of the 'rustfmt' executable in your $PATH. If
|
Set this option to the name of the "rustfmt" executable in your $PATH. If
|
||||||
not specified it defaults to 'rustfmt' : >
|
not specified it defaults to "rustfmt" : >
|
||||||
let g:rustfmt_command = 'rustfmt'
|
let g:rustfmt_command = 'rustfmt'
|
||||||
<
|
<
|
||||||
*g:rustfmt_autosave*
|
*g:rustfmt_autosave*
|
||||||
@@ -104,14 +104,14 @@ g:rustfmt_autosave~
|
|||||||
<
|
<
|
||||||
*g:rustfmt_fail_silently*
|
*g:rustfmt_fail_silently*
|
||||||
g:rustfmt_fail_silently~
|
g:rustfmt_fail_silently~
|
||||||
Set this option to 1 to prevent 'rustfmt' from populating the
|
Set this option to 1 to prevent "rustfmt" from populating the
|
||||||
|location-list| with errors. If not specified it defaults to 0: >
|
|location-list| with errors. If not specified it defaults to 0: >
|
||||||
let g:rustfmt_fail_silently = 0
|
let g:rustfmt_fail_silently = 0
|
||||||
<
|
<
|
||||||
*g:rustfmt_options*
|
*g:rustfmt_options*
|
||||||
g:rustfmt_options~
|
g:rustfmt_options~
|
||||||
Set this option to a string of options to pass to 'rustfmt'. The
|
Set this option to a string of options to pass to 'rustfmt'. The
|
||||||
write-mode is already set to 'overwrite'. If not specified it
|
write-mode is already set to "overwrite". If not specified it
|
||||||
defaults to '' : >
|
defaults to '' : >
|
||||||
let g:rustfmt_options = ''
|
let g:rustfmt_options = ''
|
||||||
<
|
<
|
||||||
|
@@ -244,7 +244,7 @@ key to complete the optional parameter.
|
|||||||
After typing the function name and a space, you can use the completion to
|
After typing the function name and a space, you can use the completion to
|
||||||
supply a parameter. The function takes the name of the Vim script you want to
|
supply a parameter. The function takes the name of the Vim script you want to
|
||||||
source. Using the |cmdline-completion| feature, the SQLSetType function will
|
source. Using the |cmdline-completion| feature, the SQLSetType function will
|
||||||
search the |'runtimepath'| for all Vim scripts with a name containing 'sql'.
|
search the |'runtimepath'| for all Vim scripts with a name containing "sql".
|
||||||
This takes the guess work out of the spelling of the names. The following are
|
This takes the guess work out of the spelling of the names. The following are
|
||||||
examples: >
|
examples: >
|
||||||
:SQLSetType
|
:SQLSetType
|
||||||
|
@@ -98,7 +98,6 @@ General subjects ~
|
|||||||
|help.txt| overview and quick reference (this file)
|
|help.txt| overview and quick reference (this file)
|
||||||
|helphelp.txt| about using the help files
|
|helphelp.txt| about using the help files
|
||||||
|index.txt| alphabetical index of all commands
|
|index.txt| alphabetical index of all commands
|
||||||
|help-tags| all the tags you can jump to (index of tags)
|
|
||||||
|tips.txt| various tips on using Vim
|
|tips.txt| various tips on using Vim
|
||||||
|message.txt| (error) messages and explanations
|
|message.txt| (error) messages and explanations
|
||||||
|develop.txt| development of Nvim
|
|develop.txt| development of Nvim
|
||||||
|
@@ -13,7 +13,6 @@ to look for deleting something, use: "/delete".
|
|||||||
For an overview of options see |option-list|.
|
For an overview of options see |option-list|.
|
||||||
For an overview of built-in functions see |functions|.
|
For an overview of built-in functions see |functions|.
|
||||||
For a list of Vim variables see |vim-variable|.
|
For a list of Vim variables see |vim-variable|.
|
||||||
For a complete listing of all help items see |help-tags|.
|
|
||||||
|
|
||||||
Type |gO| to see the table of contents.
|
Type |gO| to see the table of contents.
|
||||||
|
|
||||||
@@ -61,7 +60,7 @@ tag char action in Insert mode ~
|
|||||||
|i_CTRL-Q| CTRL-Q same as CTRL-V, unless used for terminal
|
|i_CTRL-Q| CTRL-Q same as CTRL-V, unless used for terminal
|
||||||
control flow
|
control flow
|
||||||
|i_CTRL-SHIFT-Q| CTRL-SHIFT-Q {char}
|
|i_CTRL-SHIFT-Q| CTRL-SHIFT-Q {char}
|
||||||
like CTRL-Q unless |modifyOtherKeys| is active
|
like CTRL-Q unless |tui-modifyOtherKeys| is active
|
||||||
|i_CTRL-R| CTRL-R {register}
|
|i_CTRL-R| CTRL-R {register}
|
||||||
insert the contents of a register
|
insert the contents of a register
|
||||||
|i_CTRL-R_CTRL-R| CTRL-R CTRL-R {register}
|
|i_CTRL-R_CTRL-R| CTRL-R CTRL-R {register}
|
||||||
@@ -79,7 +78,7 @@ tag char action in Insert mode ~
|
|||||||
line
|
line
|
||||||
|i_CTRL-V| CTRL-V {char} insert next non-digit literally
|
|i_CTRL-V| CTRL-V {char} insert next non-digit literally
|
||||||
|i_CTRL-SHIFT-V| CTRL-SHIFT-V {char}
|
|i_CTRL-SHIFT-V| CTRL-SHIFT-V {char}
|
||||||
like CTRL-V unless |modifyOtherKeys| is active
|
like CTRL-V unless |tui-modifyOtherKeys| is active
|
||||||
|i_CTRL-V_digit| CTRL-V {number} insert three digit decimal number as a single
|
|i_CTRL-V_digit| CTRL-V {number} insert three digit decimal number as a single
|
||||||
byte.
|
byte.
|
||||||
|i_CTRL-W| CTRL-W delete word before the cursor
|
|i_CTRL-W| CTRL-W delete word before the cursor
|
||||||
@@ -454,14 +453,14 @@ tag char note action in Normal mode ~
|
|||||||
|<S-Up>| <S-Up> 1 same as CTRL-B
|
|<S-Up>| <S-Up> 1 same as CTRL-B
|
||||||
|<Undo>| <Undo> 2 same as "u"
|
|<Undo>| <Undo> 2 same as "u"
|
||||||
|<Up>| <Up> 1 same as "k"
|
|<Up>| <Up> 1 same as "k"
|
||||||
|<ScrollWheelDown>| <ScrollWheelDown> move window three lines down
|
*<ScrollWheelDown>* <ScrollWheelDown> move window three lines down
|
||||||
|<S-ScrollWheelDown>| <S-ScrollWheelDown> move window one page down
|
*<S-ScrollWheelDown>* <S-ScrollWheelDown> move window one page down
|
||||||
|<ScrollWheelUp>| <ScrollWheelUp> move window three lines up
|
*<ScrollWheelUp>* <ScrollWheelUp> move window three lines up
|
||||||
|<S-ScrollWheelUp>| <S-ScrollWheelUp> move window one page up
|
*<S-ScrollWheelUp>* <S-ScrollWheelUp> move window one page up
|
||||||
|<ScrollWheelLeft>| <ScrollWheelLeft> move window six columns left
|
*<ScrollWheelLeft>* <ScrollWheelLeft> move window six columns left
|
||||||
|<S-ScrollWheelLeft>| <S-ScrollWheelLeft> move window one page left
|
*<S-ScrollWheelLeft>* <S-ScrollWheelLeft> move window one page left
|
||||||
|<ScrollWheelRight>| <ScrollWheelRight> move window six columns right
|
*<ScrollWheelRight>* <ScrollWheelRight> move window six columns right
|
||||||
|<S-ScrollWheelRight>| <S-ScrollWheelRight> move window one page right
|
*<S-ScrollWheelRight>* <S-ScrollWheelRight> move window one page right
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
2.1 Text objects *objects*
|
2.1 Text objects *objects*
|
||||||
@@ -700,7 +699,7 @@ tag char note action in Normal mode ~
|
|||||||
|
|
||||||
tag char note action in Normal mode ~
|
tag char note action in Normal mode ~
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
|g_CTRL-A| g CTRL-A dump a memory profile
|
g_CTRL-A g CTRL-A dump a memory profile
|
||||||
|g_CTRL-G| g CTRL-G show information about current cursor
|
|g_CTRL-G| g CTRL-G show information about current cursor
|
||||||
position
|
position
|
||||||
|g_CTRL-H| g CTRL-H start Select block mode
|
|g_CTRL-H| g CTRL-H start Select block mode
|
||||||
|
@@ -1519,7 +1519,7 @@ RUBY *ft-ruby-omni*
|
|||||||
NOTE: |compl-omni| for Ruby code requires |provider-ruby| to be installed.
|
NOTE: |compl-omni| for Ruby code requires |provider-ruby| to be installed.
|
||||||
|
|
||||||
Ruby completion will parse your buffer on demand in order to provide a list of
|
Ruby completion will parse your buffer on demand in order to provide a list of
|
||||||
completions. These completions will be drawn from modules loaded by 'require'
|
completions. These completions will be drawn from modules loaded by "require"
|
||||||
and modules defined in the current buffer.
|
and modules defined in the current buffer.
|
||||||
|
|
||||||
The completions provided by CTRL-X CTRL-O are sensitive to the context:
|
The completions provided by CTRL-X CTRL-O are sensitive to the context:
|
||||||
@@ -1759,7 +1759,7 @@ In the example four special elements are visible:
|
|||||||
dialect.
|
dialect.
|
||||||
2. If the list containing possible values of attributes has one element and
|
2. If the list containing possible values of attributes has one element and
|
||||||
this element is equal to the name of the attribute this attribute will be
|
this element is equal to the name of the attribute this attribute will be
|
||||||
treated as boolean and inserted as 'attrname' and not as 'attrname="'
|
treated as boolean and inserted as "attrname" and not as 'attrname="'
|
||||||
3. "vimxmltaginfo" - a special key with a Dictionary containing tag
|
3. "vimxmltaginfo" - a special key with a Dictionary containing tag
|
||||||
names as keys and two element List as values, for additional menu info and
|
names as keys and two element List as values, for additional menu info and
|
||||||
the long description.
|
the long description.
|
||||||
|
@@ -40,7 +40,7 @@ Follow these steps to get LSP features:
|
|||||||
root_dir = vim.fs.dirname(vim.fs.find({'setup.py', 'pyproject.toml'}, { upward = true })[1]),
|
root_dir = vim.fs.dirname(vim.fs.find({'setup.py', 'pyproject.toml'}, { upward = true })[1]),
|
||||||
})
|
})
|
||||||
<
|
<
|
||||||
See |vim.lsp.start| for details.
|
See |vim.lsp.start()| for details.
|
||||||
|
|
||||||
3. Configure keymaps and autocmds to utilize LSP features.
|
3. Configure keymaps and autocmds to utilize LSP features.
|
||||||
See |lsp-config|.
|
See |lsp-config|.
|
||||||
@@ -48,19 +48,19 @@ Follow these steps to get LSP features:
|
|||||||
*lsp-config*
|
*lsp-config*
|
||||||
|
|
||||||
Starting a LSP client will automatically report diagnostics via
|
Starting a LSP client will automatically report diagnostics via
|
||||||
|vim.diagnostic|. Read |vim.diagnostic.config| to learn how to customize the
|
|vim.diagnostic|. Read |vim.diagnostic.config()| to learn how to customize the
|
||||||
display.
|
display.
|
||||||
|
|
||||||
It also sets some buffer options if the options are otherwise empty and if the
|
It also sets some buffer options if the options are otherwise empty and if the
|
||||||
language server supports the functionality.
|
language server supports the functionality.
|
||||||
|
|
||||||
- |omnifunc| is set to |vim.lsp.omnifunc|. This allows to trigger completion
|
- 'omnifunc' is set to |vim.lsp.omnifunc()|. This allows to trigger completion
|
||||||
using |i_CTRL-X_CTRL-o|
|
using |i_CTRL-X_CTRL-O|
|
||||||
- |tagfunc| is set to |vim.lsp.tagfunc|. This enables features like
|
- 'tagfunc' is set to |vim.lsp.tagfunc()|. This enables features like
|
||||||
go-to-definition, |:tjump|, and keymaps like |CTRL-]|, |CTRL-W_]|,
|
go-to-definition, |:tjump|, and keymaps like |CTRL-]|, |CTRL-W_]|,
|
||||||
|CTRL-W_}| to utilize the language server.
|
|CTRL-W_}| to utilize the language server.
|
||||||
- |formatexpr| is set to |vim.lsp.formatexpr| if both |formatprg| and
|
- 'formatexpr' is set to |vim.lsp.formatexpr()| if both 'formatprg' and
|
||||||
|formatexpr| are empty. This allows to format lines via |gq| if the language
|
'formatexpr' are empty. This allows to format lines via |gq| if the language
|
||||||
server supports it.
|
server supports it.
|
||||||
|
|
||||||
To use other LSP features like hover, rename, etc. you can setup some
|
To use other LSP features like hover, rename, etc. you can setup some
|
||||||
@@ -245,7 +245,7 @@ For |lsp-request|, each |lsp-handler| has this signature: >
|
|||||||
Where `err` must be shaped like an RPC error:
|
Where `err` must be shaped like an RPC error:
|
||||||
`{ code, message, data? }`
|
`{ code, message, data? }`
|
||||||
|
|
||||||
You can use |vim.lsp.rpc_response_error()| to create this object.
|
You can use |vim.lsp.rpc.rpc_response_error()| to create this object.
|
||||||
|
|
||||||
For |lsp-notification|, each |lsp-handler| has this signature: >
|
For |lsp-notification|, each |lsp-handler| has this signature: >
|
||||||
|
|
||||||
@@ -338,8 +338,8 @@ To configure the behavior of a builtin |lsp-handler|, the convenient method
|
|||||||
}
|
}
|
||||||
<
|
<
|
||||||
Some handlers do not have an explicitly named handler function (such as
|
Some handlers do not have an explicitly named handler function (such as
|
||||||
|on_publish_diagnostics()|). To override these, first create a reference
|
||vim.lsp.diagnostic.on_publish_diagnostics()|). To override these, first
|
||||||
to the existing handler: >
|
create a reference to the existing handler: >
|
||||||
|
|
||||||
local on_references = vim.lsp.handlers["textDocument/references"]
|
local on_references = vim.lsp.handlers["textDocument/references"]
|
||||||
vim.lsp.handlers["textDocument/references"] = vim.lsp.with(
|
vim.lsp.handlers["textDocument/references"] = vim.lsp.with(
|
||||||
@@ -360,7 +360,7 @@ Handlers can be set by:
|
|||||||
|
|
||||||
vim.lsp.handlers["textDocument/definition"] = my_custom_default_definition
|
vim.lsp.handlers["textDocument/definition"] = my_custom_default_definition
|
||||||
<
|
<
|
||||||
- The {handlers} parameter for |vim.lsp.start_client|.
|
- The {handlers} parameter for |vim.lsp.start_client()|.
|
||||||
This will set the |lsp-handler| as the default handler for this server.
|
This will set the |lsp-handler| as the default handler for this server.
|
||||||
|
|
||||||
For example: >
|
For example: >
|
||||||
@@ -514,7 +514,7 @@ callback in the "data" table. Example: >
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
<
|
<
|
||||||
In addition, the following |User| |autocommands| are provided:
|
Also the following |User| |autocommand|s are provided:
|
||||||
|
|
||||||
LspProgressUpdate *LspProgressUpdate*
|
LspProgressUpdate *LspProgressUpdate*
|
||||||
Upon receipt of a progress notification from the server. See
|
Upon receipt of a progress notification from the server. See
|
||||||
@@ -788,7 +788,8 @@ start({config}, {opts}) *vim.lsp.start()*
|
|||||||
})
|
})
|
||||||
<
|
<
|
||||||
|
|
||||||
See |lsp.start_client| for all available options. The most important are:
|
See |vim.lsp.start_client()| for all available options. The most important
|
||||||
|
are:
|
||||||
|
|
||||||
`name` is an arbitrary name for the LSP client. It should be unique per
|
`name` is an arbitrary name for the LSP client. It should be unique per
|
||||||
language server.
|
language server.
|
||||||
@@ -798,9 +799,9 @@ start({config}, {opts}) *vim.lsp.start()*
|
|||||||
constructs like `~` are NOT expanded.
|
constructs like `~` are NOT expanded.
|
||||||
|
|
||||||
`root_dir` path to the project root. By default this is used to decide if
|
`root_dir` path to the project root. By default this is used to decide if
|
||||||
an existing client should be re-used. The example above uses |vim.fs.find|
|
an existing client should be re-used. The example above uses
|
||||||
and |vim.fs.dirname| to detect the root by traversing the file system
|
|vim.fs.find()| and |vim.fs.dirname()| to detect the root by traversing
|
||||||
upwards starting from the current directory until either a
|
the file system upwards starting from the current directory until either a
|
||||||
`pyproject.toml` or `setup.py` file is found.
|
`pyproject.toml` or `setup.py` file is found.
|
||||||
|
|
||||||
`workspace_folders` a list of { uri:string, name: string } tables. The
|
`workspace_folders` a list of { uri:string, name: string } tables. The
|
||||||
@@ -812,13 +813,13 @@ start({config}, {opts}) *vim.lsp.start()*
|
|||||||
the project folder.
|
the project folder.
|
||||||
|
|
||||||
To ensure a language server is only started for languages it can handle,
|
To ensure a language server is only started for languages it can handle,
|
||||||
make sure to call |vim.lsp.start| within a |FileType| autocmd. Either use
|
make sure to call |vim.lsp.start()| within a |FileType| autocmd. Either
|
||||||
|:au|, |nvim_create_autocmd()| or put the call in a
|
use |:au|, |nvim_create_autocmd()| or put the call in a
|
||||||
`ftplugin/<filetype_name>.lua` (See |ftplugin-name|)
|
`ftplugin/<filetype_name>.lua` (See |ftplugin-name|)
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{config} (table) Same configuration as documented in
|
{config} (table) Same configuration as documented in
|
||||||
|lsp.start_client()|
|
|vim.lsp.start_client()|
|
||||||
{opts} nil|table Optional keyword arguments:
|
{opts} nil|table Optional keyword arguments:
|
||||||
• reuse_client (fun(client: client, config: table): boolean)
|
• reuse_client (fun(client: client, config: table): boolean)
|
||||||
Predicate used to decide if a client should be re-used.
|
Predicate used to decide if a client should be re-used.
|
||||||
@@ -837,15 +838,16 @@ start_client({config}) *vim.lsp.start_client()*
|
|||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{cmd} (table|string|fun(dispatchers: table):table)
|
{cmd} (table|string|fun(dispatchers: table):table)
|
||||||
command string or list treated like |jobstart|.
|
command string or list treated like |jobstart()|.
|
||||||
The command must launch the language server
|
The command must launch the language server
|
||||||
process. `cmd` can also be a function that
|
process. `cmd` can also be a function that
|
||||||
creates an RPC client. The function receives a
|
creates an RPC client. The function receives a
|
||||||
dispatchers table and must return a table with
|
dispatchers table and must return a table with
|
||||||
the functions `request`, `notify`, `is_closing`
|
the functions `request`, `notify`, `is_closing`
|
||||||
and `terminate` See |vim.lsp.rpc.request| and
|
and `terminate` See |vim.lsp.rpc.request()| and
|
||||||
|vim.lsp.rpc.notify| For TCP there is a built-in
|
|vim.lsp.rpc.notify()| For TCP there is a
|
||||||
rpc client factory: |vim.lsp.rpc.connect|
|
built-in rpc client factory:
|
||||||
|
|vim.lsp.rpc.connect()|
|
||||||
{cmd_cwd} (string, default=|getcwd()|) Directory to launch
|
{cmd_cwd} (string, default=|getcwd()|) Directory to launch
|
||||||
the `cmd` process. Not related to `root_dir`.
|
the `cmd` process. Not related to `root_dir`.
|
||||||
{cmd_env} (table) Environment flags to pass to the LSP on
|
{cmd_env} (table) Environment flags to pass to the LSP on
|
||||||
@@ -900,7 +902,7 @@ start_client({config}) *vim.lsp.start_client()*
|
|||||||
when the client operation throws an error. `code`
|
when the client operation throws an error. `code`
|
||||||
is a number describing the error. Other arguments
|
is a number describing the error. Other arguments
|
||||||
may be passed depending on the error kind. See
|
may be passed depending on the error kind. See
|
||||||
|vim.lsp.rpc.client_errors| for possible errors.
|
`vim.lsp.rpc.client_errors` for possible errors.
|
||||||
Use `vim.lsp.rpc.client_errors[code]` to get
|
Use `vim.lsp.rpc.client_errors[code]` to get
|
||||||
human-friendly name.
|
human-friendly name.
|
||||||
{before_init} Callback with parameters (initialize_params,
|
{before_init} Callback with parameters (initialize_params,
|
||||||
@@ -945,9 +947,9 @@ start_client({config}) *vim.lsp.start_client()*
|
|||||||
debounce occurs if nil
|
debounce occurs if nil
|
||||||
• exit_timeout (number|boolean, default false):
|
• exit_timeout (number|boolean, default false):
|
||||||
Milliseconds to wait for server to exit cleanly
|
Milliseconds to wait for server to exit cleanly
|
||||||
after sending the 'shutdown' request before
|
after sending the "shutdown" request before
|
||||||
sending kill -15. If set to false, nvim exits
|
sending kill -15. If set to false, nvim exits
|
||||||
immediately after sending the 'shutdown'
|
immediately after sending the "shutdown"
|
||||||
request to the server.
|
request to the server.
|
||||||
{root_dir} (string) Directory where the LSP server will base
|
{root_dir} (string) Directory where the LSP server will base
|
||||||
its workspaceFolders, rootUri, and rootPath on
|
its workspaceFolders, rootUri, and rootPath on
|
||||||
@@ -1047,7 +1049,7 @@ completion({context}) *vim.lsp.buf.completion()*
|
|||||||
character, if applicable)
|
character, if applicable)
|
||||||
|
|
||||||
See also: ~
|
See also: ~
|
||||||
|vim.lsp.protocol.constants.CompletionTriggerKind|
|
vim.lsp.protocol.constants.CompletionTriggerKind
|
||||||
|
|
||||||
declaration({options}) *vim.lsp.buf.declaration()*
|
declaration({options}) *vim.lsp.buf.declaration()*
|
||||||
Jumps to the declaration of the symbol under the cursor.
|
Jumps to the declaration of the symbol under the cursor.
|
||||||
@@ -1084,7 +1086,8 @@ document_highlight() *vim.lsp.buf.document_highlight()*
|
|||||||
|
|
||||||
Note: Usage of |vim.lsp.buf.document_highlight()| requires the following
|
Note: Usage of |vim.lsp.buf.document_highlight()| requires the following
|
||||||
highlight groups to be defined or you won't be able to see the actual
|
highlight groups to be defined or you won't be able to see the actual
|
||||||
highlights. |LspReferenceText| |LspReferenceRead| |LspReferenceWrite|
|
highlights. |hl-LspReferenceText| |hl-LspReferenceRead|
|
||||||
|
|hl-LspReferenceWrite|
|
||||||
|
|
||||||
document_symbol({options}) *vim.lsp.buf.document_symbol()*
|
document_symbol({options}) *vim.lsp.buf.document_symbol()*
|
||||||
Lists all symbols in the current buffer in the quickfix window.
|
Lists all symbols in the current buffer in the quickfix window.
|
||||||
@@ -1193,7 +1196,7 @@ formatting_sync({options}, {timeout_ms})
|
|||||||
{timeout_ms} (number) Request timeout
|
{timeout_ms} (number) Request timeout
|
||||||
|
|
||||||
See also: ~
|
See also: ~
|
||||||
|vim.lsp.buf.formatting_seq_sync|
|
|vim.lsp.buf.format()|
|
||||||
|
|
||||||
hover() *vim.lsp.buf.hover()*
|
hover() *vim.lsp.buf.hover()*
|
||||||
Displays hover information about the symbol under the cursor in a floating
|
Displays hover information about the symbol under the cursor in a floating
|
||||||
@@ -1211,7 +1214,7 @@ implementation({options}) *vim.lsp.buf.implementation()*
|
|||||||
incoming_calls() *vim.lsp.buf.incoming_calls()*
|
incoming_calls() *vim.lsp.buf.incoming_calls()*
|
||||||
Lists all the call sites of the symbol under the cursor in the |quickfix|
|
Lists all the call sites of the symbol under the cursor in the |quickfix|
|
||||||
window. If the symbol can resolve to multiple items, the user can pick one
|
window. If the symbol can resolve to multiple items, the user can pick one
|
||||||
in the |inputlist|.
|
in the |inputlist()|.
|
||||||
|
|
||||||
list_workspace_folders() *vim.lsp.buf.list_workspace_folders()*
|
list_workspace_folders() *vim.lsp.buf.list_workspace_folders()*
|
||||||
List workspace folders.
|
List workspace folders.
|
||||||
@@ -1219,7 +1222,7 @@ list_workspace_folders() *vim.lsp.buf.list_workspace_folders()*
|
|||||||
outgoing_calls() *vim.lsp.buf.outgoing_calls()*
|
outgoing_calls() *vim.lsp.buf.outgoing_calls()*
|
||||||
Lists all the items that are called by the symbol under the cursor in the
|
Lists all the items that are called by the symbol under the cursor in the
|
||||||
|quickfix| window. If the symbol can resolve to multiple items, the user
|
|quickfix| window. If the symbol can resolve to multiple items, the user
|
||||||
can pick one in the |inputlist|.
|
can pick one in the |inputlist()|.
|
||||||
|
|
||||||
*vim.lsp.buf.range_code_action()*
|
*vim.lsp.buf.range_code_action()*
|
||||||
range_code_action({context}, {start_pos}, {end_pos})
|
range_code_action({context}, {start_pos}, {end_pos})
|
||||||
@@ -1434,7 +1437,7 @@ signature_help({_}, {result}, {ctx}, {config})
|
|||||||
{config} (table) Configuration table.
|
{config} (table) Configuration table.
|
||||||
• border: (default=nil)
|
• border: (default=nil)
|
||||||
• Add borders to the floating window
|
• Add borders to the floating window
|
||||||
• See |vim.api.nvim_open_win()|
|
• See |nvim_open_win()|
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
@@ -1565,7 +1568,7 @@ get_effective_tabstop({bufnr}) *vim.lsp.util.get_effective_tabstop()*
|
|||||||
(number) indentation size
|
(number) indentation size
|
||||||
|
|
||||||
See also: ~
|
See also: ~
|
||||||
|shiftwidth|
|
'shiftwidth'
|
||||||
|
|
||||||
*vim.lsp.util.jump_to_location()*
|
*vim.lsp.util.jump_to_location()*
|
||||||
jump_to_location({location}, {offset_encoding}, {reuse_win})
|
jump_to_location({location}, {offset_encoding}, {reuse_win})
|
||||||
@@ -1722,7 +1725,7 @@ open_floating_preview({contents}, {syntax}, {opts})
|
|||||||
{contents} (table) of lines to show in window
|
{contents} (table) of lines to show in window
|
||||||
{syntax} (string) of syntax to set for opened buffer
|
{syntax} (string) of syntax to set for opened buffer
|
||||||
{opts} (table) with optional fields (additional keys are passed
|
{opts} (table) with optional fields (additional keys are passed
|
||||||
on to |vim.api.nvim_open_win()|)
|
on to |nvim_open_win()|)
|
||||||
• height: (number) height of floating window
|
• height: (number) height of floating window
|
||||||
• width: (number) width of floating window
|
• width: (number) width of floating window
|
||||||
• wrap: (boolean, default true) wrap long lines
|
• wrap: (boolean, default true) wrap long lines
|
||||||
@@ -1859,7 +1862,7 @@ try_trim_markdown_code_blocks({lines})
|
|||||||
{lines} (table) list of lines
|
{lines} (table) list of lines
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
(string) filetype or 'markdown' if it was unchanged.
|
(string) filetype or "markdown" if it was unchanged.
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
@@ -1964,7 +1967,7 @@ start({cmd}, {cmd_args}, {dispatchers}, {extra_spawn_params})
|
|||||||
Starts an LSP server process and create an LSP RPC client object to
|
Starts an LSP server process and create an LSP RPC client object to
|
||||||
interact with it. Communication with the spawned process happens via
|
interact with it. Communication with the spawned process happens via
|
||||||
stdio. For communication via TCP, spawn a process manually and use
|
stdio. For communication via TCP, spawn a process manually and use
|
||||||
|vim.lsp.rpc.connect|
|
|vim.lsp.rpc.connect()|
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{cmd} (string) Command to start the LSP server.
|
{cmd} (string) Command to start the LSP server.
|
||||||
|
@@ -285,7 +285,7 @@ These commands execute a Lua chunk from either the command line (:lua, :luado)
|
|||||||
or a file (:luafile) on the given line [range]. As always in Lua, each chunk
|
or a file (:luafile) on the given line [range]. As always in Lua, each chunk
|
||||||
has its own scope (closure), so only global variables are shared between
|
has its own scope (closure), so only global variables are shared between
|
||||||
command calls. The |lua-stdlib| modules, user modules, and anything else on
|
command calls. The |lua-stdlib| modules, user modules, and anything else on
|
||||||
|lua-package-path| are available.
|
|package.path| are available.
|
||||||
|
|
||||||
The Lua print() function redirects its output to the Nvim message area, with
|
The Lua print() function redirects its output to the Nvim message area, with
|
||||||
arguments separated by " " (space) instead of "\t" (tab).
|
arguments separated by " " (space) instead of "\t" (tab).
|
||||||
@@ -617,7 +617,7 @@ A subset of the `vim.*` API is available in threads. This includes:
|
|||||||
|
|
||||||
- `vim.loop` with a separate event loop per thread.
|
- `vim.loop` with a separate event loop per thread.
|
||||||
- `vim.mpack` and `vim.json` (useful for serializing messages between threads)
|
- `vim.mpack` and `vim.json` (useful for serializing messages between threads)
|
||||||
- `require` in threads can use lua packages from the global |lua-package-path|
|
- `require` in threads can use lua packages from the global |package.path|
|
||||||
- `print()` and `vim.inspect`
|
- `print()` and `vim.inspect`
|
||||||
- `vim.diff`
|
- `vim.diff`
|
||||||
- most utility functions in `vim.*` for working with pure lua values
|
- most utility functions in `vim.*` for working with pure lua values
|
||||||
@@ -663,7 +663,7 @@ vim.highlight.range({bufnr}, {ns}, {hlgroup}, {start}, {finish}, {opts})
|
|||||||
{finish} finish position (tuple {line,col})
|
{finish} finish position (tuple {line,col})
|
||||||
{opts} optional parameters:
|
{opts} optional parameters:
|
||||||
• `regtype`: type of range (characterwise, linewise,
|
• `regtype`: type of range (characterwise, linewise,
|
||||||
or blockwise, see |setreg|), default `'v'`
|
or blockwise, see |setreg()|), default `'v'`
|
||||||
• `inclusive`: range includes end position,
|
• `inclusive`: range includes end position,
|
||||||
default `false`
|
default `false`
|
||||||
• `priority`: priority of highlight, default
|
• `priority`: priority of highlight, default
|
||||||
@@ -906,7 +906,7 @@ vim.defer_fn({fn}, {timeout}) *vim.defer_fn*
|
|||||||
Defers calling {fn} until {timeout} ms passes. Use to do a one-shot timer
|
Defers calling {fn} until {timeout} ms passes. Use to do a one-shot timer
|
||||||
that calls {fn}.
|
that calls {fn}.
|
||||||
|
|
||||||
Note: The {fn} is |schedule_wrap|ped automatically, so API functions are
|
Note: The {fn} is |vim.schedule_wrap()|ped automatically, so API functions are
|
||||||
safe to call.
|
safe to call.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
@@ -1160,7 +1160,7 @@ window-scoped options. Note that this must NOT be confused with
|
|||||||
global value of a |global-local| option, see |:setglobal|.
|
global value of a |global-local| option, see |:setglobal|.
|
||||||
|
|
||||||
vim.o *vim.o*
|
vim.o *vim.o*
|
||||||
Get or set an |option|. Like `:set`. Invalid key is an error.
|
Get or set |options|. Like `:set`. Invalid key is an error.
|
||||||
|
|
||||||
Note: this works on both buffer-scoped and window-scoped options using the
|
Note: this works on both buffer-scoped and window-scoped options using the
|
||||||
current buffer and window.
|
current buffer and window.
|
||||||
@@ -1171,7 +1171,7 @@ vim.o *vim.o*
|
|||||||
print(vim.o.foo) -- error: invalid key
|
print(vim.o.foo) -- error: invalid key
|
||||||
<
|
<
|
||||||
vim.go *vim.go*
|
vim.go *vim.go*
|
||||||
Get or set a global |option|. Like `:setglobal`. Invalid key is
|
Get or set global |options|. Like `:setglobal`. Invalid key is
|
||||||
an error.
|
an error.
|
||||||
|
|
||||||
Note: this is different from |vim.o| because this accesses the global
|
Note: this is different from |vim.o| because this accesses the global
|
||||||
@@ -1260,7 +1260,7 @@ offers object-oriented method for adding and removing entries.
|
|||||||
|
|
||||||
|
|
||||||
Note that |vim.opt| returns an `Option` object, not the value of the option,
|
Note that |vim.opt| returns an `Option` object, not the value of the option,
|
||||||
which is accessed through |Option:get()|:
|
which is accessed through |vim.opt:get()|:
|
||||||
|
|
||||||
Examples: ~
|
Examples: ~
|
||||||
|
|
||||||
@@ -1275,8 +1275,8 @@ which is accessed through |Option:get()|:
|
|||||||
`vim.pretty_print(vim.opt.wildignore:get())`
|
`vim.pretty_print(vim.opt.wildignore:get())`
|
||||||
|
|
||||||
|
|
||||||
In any of the above examples, to replicate the behavior |setlocal|, use
|
In any of the above examples, to replicate the behavior |:setlocal|, use
|
||||||
`vim.opt_local`. Additionally, to replicate the behavior of |setglobal|, use
|
`vim.opt_local`. Additionally, to replicate the behavior of |:setglobal|, use
|
||||||
`vim.opt_global`.
|
`vim.opt_global`.
|
||||||
|
|
||||||
|
|
||||||
@@ -1406,8 +1406,8 @@ connection_failure_errmsg({consequence})
|
|||||||
defer_fn({fn}, {timeout}) *vim.defer_fn()*
|
defer_fn({fn}, {timeout}) *vim.defer_fn()*
|
||||||
Defers calling `fn` until `timeout` ms passes.
|
Defers calling `fn` until `timeout` ms passes.
|
||||||
|
|
||||||
Use to do a one-shot timer that calls `fn` Note: The {fn} is |schedule_wrap|ped automatically, so API functions are
|
Use to do a one-shot timer that calls `fn` Note: The {fn} is |vim.schedule_wrap()|ped automatically, so API functions
|
||||||
safe to call.
|
are safe to call.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{fn} Callback to call once `timeout` expires
|
{fn} Callback to call once `timeout` expires
|
||||||
@@ -1541,7 +1541,7 @@ region({bufnr}, {pos1}, {pos2}, {regtype}, {inclusive}) *vim.region()*
|
|||||||
{bufnr} (number) of buffer
|
{bufnr} (number) of buffer
|
||||||
{pos1} (line, column) tuple marking beginning of region
|
{pos1} (line, column) tuple marking beginning of region
|
||||||
{pos2} (line, column) tuple marking end of region
|
{pos2} (line, column) tuple marking end of region
|
||||||
{regtype} type of selection (:help setreg)
|
{regtype} type of selection, see |setreg()|
|
||||||
{inclusive} (boolean) indicating whether the selection is
|
{inclusive} (boolean) indicating whether the selection is
|
||||||
end-inclusive
|
end-inclusive
|
||||||
|
|
||||||
@@ -1773,7 +1773,7 @@ tbl_deep_extend({behavior}, {...}) *vim.tbl_deep_extend()*
|
|||||||
(table) Merged table
|
(table) Merged table
|
||||||
|
|
||||||
See also: ~
|
See also: ~
|
||||||
|tbl_extend()|
|
|vim.tbl_extend()|
|
||||||
|
|
||||||
tbl_extend({behavior}, {...}) *vim.tbl_extend()*
|
tbl_extend({behavior}, {...}) *vim.tbl_extend()*
|
||||||
Merges two or more map-like tables.
|
Merges two or more map-like tables.
|
||||||
|
@@ -20,72 +20,7 @@
|
|||||||
See |luaref-copyright| for copyright and licenses.
|
See |luaref-copyright| for copyright and licenses.
|
||||||
|
|
||||||
|
|
||||||
CONTENTS
|
Type |gO| to see the table of contents.
|
||||||
============
|
|
||||||
|
|
||||||
1 INTRODUCTION........................|luaref-intro|
|
|
||||||
|
|
||||||
2 THE LANGUAGE........................|luaref-language|
|
|
||||||
2.1 Lexical Conventions...............|luaref-langLexConv|
|
|
||||||
2.2 Values and Types..................|luaref-langValTypes|
|
|
||||||
2.2.1 Coercion........................|luaref-langCoercion|
|
|
||||||
2.3 Variables.........................|luaref-langVariables|
|
|
||||||
2.4 Statements........................|luaref-langStats|
|
|
||||||
2.4.1 Chunks..........................|luaref-langChunks|
|
|
||||||
2.4.2 Blocks..........................|luaref-langBlocks|
|
|
||||||
2.4.3 Assignment......................|luaref-langAssign|
|
|
||||||
2.4.4 Control Structures..............|luaref-langContStructs|
|
|
||||||
2.4.5 For Statement...................|luaref-langForStat|
|
|
||||||
2.4.6 Function Calls as Statements....|luaref-langFuncStat|
|
|
||||||
2.4.7 Local Declarations..............|luaref-langLocalDec|
|
|
||||||
2.5 Expressions.......................|luaref-langExpressions|
|
|
||||||
2.5.1 Arithmetic Operators............|luaref-langArithOp|
|
|
||||||
2.5.2 Relational Operators............|luaref-langRelOp|
|
|
||||||
2.5.3 Logical Operators...............|luaref-langLogOp|
|
|
||||||
2.5.4 Concatenation...................|luaref-langConcat|
|
|
||||||
2.5.5 The Length Operator.............|luaref-langLength|
|
|
||||||
2.5.6 Precedence......................|luaref-langPrec|
|
|
||||||
2.5.7 Table Constructors..............|luaref-langTableConst|
|
|
||||||
2.5.8 Function Calls..................|luaref-langFuncCalls|
|
|
||||||
2.5.9 Function Definitions............|luaref-langFuncDefs|
|
|
||||||
2.6 Visibility Rules..................|luaref-langVisibRules|
|
|
||||||
2.7 Error Handling....................|luaref-langError|
|
|
||||||
2.8 Metatables........................|luaref-langMetatables|
|
|
||||||
2.9 Environments......................|luaref-langEnvironments|
|
|
||||||
2.10 Garbage Collection...............|luaref-langGC|
|
|
||||||
2.10.1 Garbage-Collection Metamethods.|luaref-langGCMeta|
|
|
||||||
2.10.2 Weak Tables....................|luaref-langWeaktables|
|
|
||||||
2.11 Coroutines.......................|luaref-langCoro|
|
|
||||||
|
|
||||||
3 THE APPLICATION PROGRAM INTERFACE...|luaref-api|
|
|
||||||
3.1 The Stack.........................|luaref-apiStack|
|
|
||||||
3.2 Stack Size........................|luaref-apiStackSize|
|
|
||||||
3.3 Pseudo-Indices....................|luaref-apiPseudoIndices|
|
|
||||||
3.4 C Closures........................|luaref-apiCClosures|
|
|
||||||
3.5 Registry..........................|luaref-apiRegistry|
|
|
||||||
3.6 Error Handling in C...............|luaref-apiError|
|
|
||||||
3.7 Functions and Types...............|luaref-apiFunctions|
|
|
||||||
3.8 The Debug Interface...............|luaref-apiDebug|
|
|
||||||
|
|
||||||
4 THE AUXILIARY LIBRARY...............|luaref-aux|
|
|
||||||
4.1 Functions and Types...............|luaref-auxFunctions|
|
|
||||||
|
|
||||||
5 STANDARD LIBRARIES..................|luaref-lib|
|
|
||||||
5.1 Basic Functions...................|luaref-libBasic|
|
|
||||||
5.2 Coroutine Manipulation............|luaref-libCoro|
|
|
||||||
5.3 Modules...........................|luaref-libModule|
|
|
||||||
5.4 String Manipulation...............|luaref-libString|
|
|
||||||
5.4.1 Patterns........................|luaref-libStringPat|
|
|
||||||
5.5 Table Manipulation................|luaref-libTable|
|
|
||||||
5.6 Mathematical Functions............|luaref-libMath|
|
|
||||||
5.7 Input and Output Facilities.......|luaref-libIO|
|
|
||||||
5.8 Operating System Facilities.......|luaref-libOS|
|
|
||||||
5.9 The Debug Library.................|luaref-libDebug|
|
|
||||||
|
|
||||||
A BIBLIOGRAPHY........................|luaref-bibliography|
|
|
||||||
B COPYRIGHT & LICENSES................|luaref-copyright|
|
|
||||||
C LUAREF DOC..........................|luaref-doc|
|
|
||||||
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
1 INTRODUCTION *luaref-intro*
|
1 INTRODUCTION *luaref-intro*
|
||||||
@@ -292,7 +227,7 @@ parameter passing, and function returns always manipulate references to such
|
|||||||
values; these operations do not imply any kind of copy.
|
values; these operations do not imply any kind of copy.
|
||||||
|
|
||||||
The library function `type` returns a string describing the type of a given
|
The library function `type` returns a string describing the type of a given
|
||||||
value (see |luaref-type|).
|
value (see |luaref-type()|).
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
2.2.1 Coercion *luaref-langCoercion*
|
2.2.1 Coercion *luaref-langCoercion*
|
||||||
@@ -303,7 +238,7 @@ string to a number, following the usual conversion rules. Conversely, whenever
|
|||||||
a number is used where a string is expected, the number is converted to a
|
a number is used where a string is expected, the number is converted to a
|
||||||
string, in a reasonable format. For complete control of how numbers are
|
string, in a reasonable format. For complete control of how numbers are
|
||||||
converted to strings, use the `format` function from the string library (see
|
converted to strings, use the `format` function from the string library (see
|
||||||
|luaref-string.format|).
|
|string.format()|).
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
2.3 Variables *luaref-langVariables*
|
2.3 Variables *luaref-langVariables*
|
||||||
@@ -344,7 +279,7 @@ has its own reference to an environment, so that all global variables in this
|
|||||||
function will refer to this environment table. When a function is created, it
|
function will refer to this environment table. When a function is created, it
|
||||||
inherits the environment from the function that created it. To get the
|
inherits the environment from the function that created it. To get the
|
||||||
environment table of a Lua function, you call `getfenv` (see
|
environment table of a Lua function, you call `getfenv` (see
|
||||||
|luaref-getfenv|). To replace it, you call `setfenv` (see |luaref-setfenv|).
|
|lua_getfenv()|). To replace it, you call `setfenv` (see |luaref-setfenv()|).
|
||||||
(You can only manipulate the environment of C functions through the debug
|
(You can only manipulate the environment of C functions through the debug
|
||||||
library; see |luaref-libDebug|.)
|
library; see |luaref-libDebug|.)
|
||||||
|
|
||||||
@@ -634,7 +569,7 @@ they are explained in |luaref-langFuncDefs|.
|
|||||||
Binary operators comprise arithmetic operators (see |luaref-langArithOp|),
|
Binary operators comprise arithmetic operators (see |luaref-langArithOp|),
|
||||||
relational operators (see |luaref-langRelOp|), logical operators (see
|
relational operators (see |luaref-langRelOp|), logical operators (see
|
||||||
|luaref-langLogOp|), and the concatenation operator (see |luaref-langConcat|).
|
|luaref-langLogOp|), and the concatenation operator (see |luaref-langConcat|).
|
||||||
Unary operators comprise the unary minus (see |luaref-labgArithOp|), the unary
|
Unary operators comprise the unary minus (see |luaref-langArithOp|), the unary
|
||||||
`not` (see |luaref-langLogOp|), and the unary length operator (see
|
`not` (see |luaref-langLogOp|), and the unary length operator (see
|
||||||
|luaref-langLength|).
|
|luaref-langLength|).
|
||||||
|
|
||||||
@@ -1050,13 +985,13 @@ them share the same `x`.
|
|||||||
|
|
||||||
Because Lua is an embedded extension language, all Lua actions start from
|
Because Lua is an embedded extension language, all Lua actions start from
|
||||||
C code in the host program calling a function from the Lua library (see
|
C code in the host program calling a function from the Lua library (see
|
||||||
|luaref-lua_pcall|). Whenever an error occurs during Lua compilation or
|
|lua_pcall()|). Whenever an error occurs during Lua compilation or
|
||||||
execution, control returns to C, which can take appropriate measures (such as
|
execution, control returns to C, which can take appropriate measures (such as
|
||||||
print an error message).
|
print an error message).
|
||||||
|
|
||||||
Lua code can explicitly generate an error by calling the `error` function (see
|
Lua code can explicitly generate an error by calling the `error` function (see
|
||||||
|luaref-error|). If you need to catch errors in Lua, you can use
|
|luaref-error()|). If you need to catch errors in Lua, you can use
|
||||||
the `pcall` function (see |luaref-pcall|).
|
the `pcall` function (see |luaref-pcall()|).
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
2.8 Metatables *luaref-metatable* *luaref-langMetatables*
|
2.8 Metatables *luaref-metatable* *luaref-langMetatables*
|
||||||
@@ -1074,10 +1009,10 @@ previous example, the event is "add" and the metamethod is the function that
|
|||||||
performs the addition.
|
performs the addition.
|
||||||
|
|
||||||
You can query the metatable of any value through the `getmetatable` function
|
You can query the metatable of any value through the `getmetatable` function
|
||||||
(see |luaref-getmetatable|).
|
(see |luaref-getmetatable()|).
|
||||||
|
|
||||||
You can replace the metatable of tables through the `setmetatable` function (see
|
You can replace the metatable of tables through the `setmetatable` function (see
|
||||||
|luaref-setmetatable|). You cannot change the metatable of other types from Lua
|
|luaref-setmetatable()|). You cannot change the metatable of other types from Lua
|
||||||
(except using the debug library); you must use the C API for that.
|
(except using the debug library); you must use the C API for that.
|
||||||
|
|
||||||
Tables and userdata have individual metatables (although multiple tables and
|
Tables and userdata have individual metatables (although multiple tables and
|
||||||
@@ -1385,8 +1320,8 @@ convenience feature for programmers to associate a table to a userdata.
|
|||||||
|
|
||||||
Environments associated with threads are called global environments. They are
|
Environments associated with threads are called global environments. They are
|
||||||
used as the default environment for their threads and non-nested functions
|
used as the default environment for their threads and non-nested functions
|
||||||
created by the thread (through `loadfile` |luaref-loadfile|, `loadstring`
|
created by the thread (through `loadfile` |luaref-loadfile()|, `loadstring`
|
||||||
|luaref-loadstring| or `load` |luaref-load|) and can be directly accessed by C
|
|luaref-loadstring()| or `load` |luaref-load()|) and can be directly accessed by C
|
||||||
code (see |luaref-apiPseudoIndices|).
|
code (see |luaref-apiPseudoIndices|).
|
||||||
|
|
||||||
Environments associated with C functions can be directly accessed by C code
|
Environments associated with C functions can be directly accessed by C code
|
||||||
@@ -1399,10 +1334,10 @@ used as the default environment for other Lua functions created by the
|
|||||||
function.
|
function.
|
||||||
|
|
||||||
You can change the environment of a Lua function or the running thread by
|
You can change the environment of a Lua function or the running thread by
|
||||||
calling `setfenv` (see |luaref-setenv|). You can get the environment of a Lua
|
calling `setfenv`. You can get the environment of a Lua function or the
|
||||||
function or the running thread by calling `getfenv` (see |luaref-getfenv|). To
|
running thread by calling `getfenv` (see |lua_getfenv()|). To manipulate the
|
||||||
manipulate the environment of other objects (userdata, C functions, other
|
environment of other objects (userdata, C functions, other threads) you must
|
||||||
threads) you must use the C API.
|
use the C API.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
2.10 Garbage Collection *luaref-langGC*
|
2.10 Garbage Collection *luaref-langGC*
|
||||||
@@ -1432,8 +1367,8 @@ collector too slow and may result in the collector never finishing a cycle.
|
|||||||
The default, 2, means that the collector runs at "twice" the speed of memory
|
The default, 2, means that the collector runs at "twice" the speed of memory
|
||||||
allocation.
|
allocation.
|
||||||
|
|
||||||
You can change these numbers by calling `lua_gc` (see |luaref-lua_gc|) in C or
|
You can change these numbers by calling `lua_gc` (see |lua_gc()|) in C or
|
||||||
`collectgarbage` (see |luaref-collectgarbage|) in Lua. Both get percentage
|
`collectgarbage` (see |luaref-collectgarbage()|) in Lua. Both get percentage
|
||||||
points as arguments (so an argument of 100 means a real value of 1). With
|
points as arguments (so an argument of 100 means a real value of 1). With
|
||||||
these functions you can also control the collector directly (e.g., stop and
|
these functions you can also control the collector directly (e.g., stop and
|
||||||
restart it).
|
restart it).
|
||||||
@@ -1496,12 +1431,12 @@ multithread systems, however, a coroutine only suspends its execution by
|
|||||||
explicitly calling a yield function.
|
explicitly calling a yield function.
|
||||||
|
|
||||||
You create a coroutine with a call to `coroutine.create` (see
|
You create a coroutine with a call to `coroutine.create` (see
|
||||||
|luaref-coroutine.create|). Its sole argument is a function that is the main
|
|coroutine.create()|). Its sole argument is a function that is the main
|
||||||
function of the coroutine. The `create` function only creates a new coroutine
|
function of the coroutine. The `create` function only creates a new coroutine
|
||||||
and returns a handle to it (an object of type `thread`); it does not start the
|
and returns a handle to it (an object of type `thread`); it does not start the
|
||||||
coroutine execution.
|
coroutine execution.
|
||||||
|
|
||||||
When you first call `coroutine.resume` (see |luaref-coroutine.resume|),
|
When you first call `coroutine.resume` (see |coroutine.resume()|),
|
||||||
passing as its first argument the thread returned by `coroutine.create`, the
|
passing as its first argument the thread returned by `coroutine.create`, the
|
||||||
coroutine starts its execution, at the first line of its main function. Extra
|
coroutine starts its execution, at the first line of its main function. Extra
|
||||||
arguments passed to `coroutine.resume` are passed on to the coroutine main
|
arguments passed to `coroutine.resume` are passed on to the coroutine main
|
||||||
@@ -1516,7 +1451,7 @@ main function. In case of errors, `coroutine.resume` returns `false` plus an
|
|||||||
error message.
|
error message.
|
||||||
|
|
||||||
A coroutine yields by calling `coroutine.yield` (see
|
A coroutine yields by calling `coroutine.yield` (see
|
||||||
|luaref-coroutine.yield|). When a coroutine yields, the corresponding
|
|coroutine.yield()|). When a coroutine yields, the corresponding
|
||||||
`coroutine.resume` returns immediately, even if the yield happens inside
|
`coroutine.resume` returns immediately, even if the yield happens inside
|
||||||
nested function calls (that is, not in the main function, but in a function
|
nested function calls (that is, not in the main function, but in a function
|
||||||
directly or indirectly called by the main function). In the case of a yield,
|
directly or indirectly called by the main function). In the case of a yield,
|
||||||
@@ -1526,7 +1461,7 @@ its execution from the point where it yielded, with the call to
|
|||||||
`coroutine.yield` returning any extra arguments passed to `coroutine.resume`.
|
`coroutine.yield` returning any extra arguments passed to `coroutine.resume`.
|
||||||
|
|
||||||
Like `coroutine.create`, the `coroutine.wrap` function (see
|
Like `coroutine.create`, the `coroutine.wrap` function (see
|
||||||
|luaref-coroutine.wrap|) also creates a coroutine, but instead of returning
|
|coroutine.wrap()|) also creates a coroutine, but instead of returning
|
||||||
the coroutine itself, it returns a function that, when called, resumes the
|
the coroutine itself, it returns a function that, when called, resumes the
|
||||||
coroutine. Any arguments passed to this function go as extra arguments to
|
coroutine. Any arguments passed to this function go as extra arguments to
|
||||||
`coroutine.resume`. `coroutine.wrap` returns all the values returned by
|
`coroutine.resume`. `coroutine.wrap` returns all the values returned by
|
||||||
@@ -1595,7 +1530,7 @@ Whenever Lua calls C, the called function gets a new stack, which is
|
|||||||
independent of previous stacks and of stacks of C functions that are still
|
independent of previous stacks and of stacks of C functions that are still
|
||||||
active. This stack initially contains any arguments to the C function and it
|
active. This stack initially contains any arguments to the C function and it
|
||||||
is where the C function pushes its results to be returned to the caller (see
|
is where the C function pushes its results to be returned to the caller (see
|
||||||
|luaref-lua_CFunction|).
|
|lua_CFunction()|).
|
||||||
|
|
||||||
*luaref-stackindex*
|
*luaref-stackindex*
|
||||||
For convenience, most query operations in the API do not follow a strict stack
|
For convenience, most query operations in the API do not follow a strict stack
|
||||||
@@ -1615,7 +1550,7 @@ if `1 <= abs(index) <= top`).
|
|||||||
When you interact with Lua API, you are responsible for ensuring consistency.
|
When you interact with Lua API, you are responsible for ensuring consistency.
|
||||||
In particular, you are responsible for controlling stack overflow. You can
|
In particular, you are responsible for controlling stack overflow. You can
|
||||||
use the function `lua_checkstack` to grow the stack size (see
|
use the function `lua_checkstack` to grow the stack size (see
|
||||||
|luaref-lua_checkstack|).
|
|lua_checkstack()|).
|
||||||
|
|
||||||
Whenever Lua calls C, it ensures that at least `LUA_MINSTACK` stack positions
|
Whenever Lua calls C, it ensures that at least `LUA_MINSTACK` stack positions
|
||||||
are available. `LUA_MINSTACK` is defined as 20, so that usually you do not
|
are available. `LUA_MINSTACK` is defined as 20, so that usually you do not
|
||||||
@@ -1656,14 +1591,14 @@ global variable, do
|
|||||||
|
|
||||||
When a C function is created, it is possible to associate some values with it,
|
When a C function is created, it is possible to associate some values with it,
|
||||||
thus creating a C closure; these values are called upvalues and are accessible
|
thus creating a C closure; these values are called upvalues and are accessible
|
||||||
to the function whenever it is called (see |luaref-lua_pushcclosure|).
|
to the function whenever it is called (see |lua_pushcclosure()|).
|
||||||
|
|
||||||
Whenever a C function is called, its upvalues are located at specific
|
Whenever a C function is called, its upvalues are located at specific
|
||||||
pseudo-indices. These pseudo-indices are produced by the macro
|
pseudo-indices. These pseudo-indices are produced by the macro
|
||||||
`lua_upvalueindex` (see |luaref-lua_upvalueindex|). The first value associated
|
`lua_upvalueindex`. The first value associated with a function is at position
|
||||||
with a function is at position `lua_upvalueindex(1)`, and so on. Any access to
|
`lua_upvalueindex(1)`, and so on. Any access to `lua_upvalueindex(` `n` `)`,
|
||||||
`lua_upvalueindex(` `n` `)`, where `n` is greater than the number of upvalues of
|
where `n` is greater than the number of upvalues of the current function,
|
||||||
the current function, produces an acceptable (but invalid) index.
|
produces an acceptable (but invalid) index.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
3.5 Registry *luaref-registry* *luaref-apiRegistry*
|
3.5 Registry *luaref-registry* *luaref-apiRegistry*
|
||||||
@@ -1694,11 +1629,11 @@ Almost any function in the API may raise an error, for instance due to a
|
|||||||
memory allocation error. The following functions run in protected mode (that
|
memory allocation error. The following functions run in protected mode (that
|
||||||
is, they create a protected environment to run), so they never raise an error:
|
is, they create a protected environment to run), so they never raise an error:
|
||||||
`lua_newstate`, `lua_close`, `lua_load`, `lua_pcall`, and `lua_cpcall` (see
|
`lua_newstate`, `lua_close`, `lua_load`, `lua_pcall`, and `lua_cpcall` (see
|
||||||
|luaref-lua_newstate|, |luaref-lua_close|, |luaref-lua_load|,
|
|lua_newstate()|, |lua_close()|, |lua_load()|,
|
||||||
|luaref-lua_pcall|, and |luaref-lua_cpcall|).
|
|lua_pcall()|, and |lua_cpcall()|).
|
||||||
|
|
||||||
Inside a C function you can raise an error by calling `lua_error` (see
|
Inside a C function you can raise an error by calling `lua_error` (see
|
||||||
|luaref-lua_error|).
|
|lua_error()|).
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
3.7 Functions and Types *luaref-apiFunctions*
|
3.7 Functions and Types *luaref-apiFunctions*
|
||||||
@@ -1715,7 +1650,7 @@ lua_Alloc *lua_Alloc()*
|
|||||||
The type of the memory-allocation function used by Lua states. The
|
The type of the memory-allocation function used by Lua states. The
|
||||||
allocator function must provide a functionality similar to `realloc`,
|
allocator function must provide a functionality similar to `realloc`,
|
||||||
but not exactly the same. Its arguments are `ud`, an opaque pointer
|
but not exactly the same. Its arguments are `ud`, an opaque pointer
|
||||||
passed to `lua_newstate` (see |luaref-lua_newstate|); `ptr`, a pointer
|
passed to `lua_newstate` (see |lua_newstate()|); `ptr`, a pointer
|
||||||
to the block being allocated/reallocated/freed; `osize`, the original
|
to the block being allocated/reallocated/freed; `osize`, the original
|
||||||
size of the block; `nsize`, the new size of the block. `ptr` is `NULL`
|
size of the block; `nsize`, the new size of the block. `ptr` is `NULL`
|
||||||
if and only if `osize` is zero. When `nsize` is zero, the allocator
|
if and only if `osize` is zero. When `nsize` is zero, the allocator
|
||||||
@@ -1729,7 +1664,7 @@ lua_Alloc *lua_Alloc()*
|
|||||||
|
|
||||||
Here is a simple implementation for the allocator function. It is used
|
Here is a simple implementation for the allocator function. It is used
|
||||||
in the auxiliary library by `luaL_newstate` (see
|
in the auxiliary library by `luaL_newstate` (see
|
||||||
|luaref-luaL_newstate|).
|
|luaL_newstate()|).
|
||||||
>
|
>
|
||||||
static void *l_alloc (void *ud, void *ptr, size_t osize,
|
static void *l_alloc (void *ud, void *ptr, size_t osize,
|
||||||
size_t nsize) {
|
size_t nsize) {
|
||||||
@@ -1813,7 +1748,7 @@ lua_CFunction *luaref-cfunction* *lua_CFunction()*
|
|||||||
following protocol, which defines the way parameters and results are
|
following protocol, which defines the way parameters and results are
|
||||||
passed: a C function receives its arguments from Lua in its stack in
|
passed: a C function receives its arguments from Lua in its stack in
|
||||||
direct order (the first argument is pushed first). So, when the
|
direct order (the first argument is pushed first). So, when the
|
||||||
function starts, `lua_gettop(L)` (see |luaref-lua_gettop|) returns the
|
function starts, `lua_gettop(L)` (see |lua_gettop()|) returns the
|
||||||
number of arguments received by the function. The first argument (if
|
number of arguments received by the function. The first argument (if
|
||||||
any) is at index 1 and its last argument is at index `lua_gettop(L)`.
|
any) is at index 1 and its last argument is at index `lua_gettop(L)`.
|
||||||
To return values to Lua, a C function just pushes them onto the stack,
|
To return values to Lua, a C function just pushes them onto the stack,
|
||||||
@@ -1881,7 +1816,7 @@ lua_cpcall *lua_cpcall()*
|
|||||||
Calls the C function `func` in protected mode. `func` starts with only
|
Calls the C function `func` in protected mode. `func` starts with only
|
||||||
one element in its stack, a light userdata containing `ud`. In case of
|
one element in its stack, a light userdata containing `ud`. In case of
|
||||||
errors, `lua_cpcall` returns the same error codes as `lua_pcall` (see
|
errors, `lua_cpcall` returns the same error codes as `lua_pcall` (see
|
||||||
|luaref-lua_pcall|), plus the error object on the top of the stack;
|
|lua_pcall()|), plus the error object on the top of the stack;
|
||||||
otherwise, it returns zero, and does not change the stack. All values
|
otherwise, it returns zero, and does not change the stack. All values
|
||||||
returned by `func` are discarded.
|
returned by `func` are discarded.
|
||||||
|
|
||||||
@@ -1893,7 +1828,7 @@ lua_createtable *lua_createtable()*
|
|||||||
has space pre-allocated for `narr` array elements and `nrec` non-array
|
has space pre-allocated for `narr` array elements and `nrec` non-array
|
||||||
elements. This pre-allocation is useful when you know exactly how many
|
elements. This pre-allocation is useful when you know exactly how many
|
||||||
elements the table will have. Otherwise you can use the function
|
elements the table will have. Otherwise you can use the function
|
||||||
`lua_newtable` (see |luaref-lua_newtable|).
|
`lua_newtable` (see |lua_newtable()|).
|
||||||
|
|
||||||
lua_dump *lua_dump()*
|
lua_dump *lua_dump()*
|
||||||
>
|
>
|
||||||
@@ -1903,7 +1838,7 @@ lua_dump *lua_dump()*
|
|||||||
of the stack and produces a binary chunk that, if loaded again,
|
of the stack and produces a binary chunk that, if loaded again,
|
||||||
results in a function equivalent to the one dumped. As it produces
|
results in a function equivalent to the one dumped. As it produces
|
||||||
parts of the chunk, `lua_dump` calls function `writer` (see
|
parts of the chunk, `lua_dump` calls function `writer` (see
|
||||||
|luaref-lua_Writer|) with the given `data` to write them.
|
|lua_Writer()|) with the given `data` to write them.
|
||||||
|
|
||||||
The value returned is the error code returned by the last call to the
|
The value returned is the error code returned by the last call to the
|
||||||
writer; 0 means no errors.
|
writer; 0 means no errors.
|
||||||
@@ -1925,7 +1860,7 @@ lua_error *lua_error()*
|
|||||||
<
|
<
|
||||||
Generates a Lua error. The error message (which can actually be a Lua
|
Generates a Lua error. The error message (which can actually be a Lua
|
||||||
value of any type) must be on the stack top. This function does a long
|
value of any type) must be on the stack top. This function does a long
|
||||||
jump, and therefore never returns (see |luaref-luaL_error|).
|
jump, and therefore never returns (see |luaL_error()|).
|
||||||
|
|
||||||
lua_gc *lua_gc()*
|
lua_gc *lua_gc()*
|
||||||
>
|
>
|
||||||
@@ -1965,7 +1900,7 @@ lua_getallocf *lua_getallocf()*
|
|||||||
<
|
<
|
||||||
Returns the memory-allocation function of a given state. If `ud` is
|
Returns the memory-allocation function of a given state. If `ud` is
|
||||||
not `NULL`, Lua stores in `*ud` the opaque pointer passed to
|
not `NULL`, Lua stores in `*ud` the opaque pointer passed to
|
||||||
`lua_newstate` (see |luaref-lua_newstate|).
|
`lua_newstate` (see |lua_newstate()|).
|
||||||
|
|
||||||
lua_getfenv *lua_getfenv()*
|
lua_getfenv *lua_getfenv()*
|
||||||
>
|
>
|
||||||
@@ -2136,10 +2071,10 @@ lua_load *lua_load()*
|
|||||||
This function only loads a chunk; it does not run it.
|
This function only loads a chunk; it does not run it.
|
||||||
|
|
||||||
`lua_load` automatically detects whether the chunk is text or binary,
|
`lua_load` automatically detects whether the chunk is text or binary,
|
||||||
and loads it accordingly (see program `luac`, |luaref-luac|).
|
and loads it accordingly (see program `luac`).
|
||||||
|
|
||||||
The `lua_load` function uses a user-supplied `reader` function to read
|
The `lua_load` function uses a user-supplied `reader` function to read
|
||||||
the chunk (see |luaref-lua_Reader|). The `data` argument is an opaque
|
the chunk (see |lua_Reader()|). The `data` argument is an opaque
|
||||||
value passed to the reader function.
|
value passed to the reader function.
|
||||||
|
|
||||||
The `chunkname` argument gives a name to the chunk, which is used for
|
The `chunkname` argument gives a name to the chunk, which is used for
|
||||||
@@ -2161,14 +2096,14 @@ lua_newtable *lua_newtable()*
|
|||||||
<
|
<
|
||||||
Creates a new empty table and pushes it onto the stack. It is
|
Creates a new empty table and pushes it onto the stack. It is
|
||||||
equivalent to `lua_createtable(L, 0, 0)` (see
|
equivalent to `lua_createtable(L, 0, 0)` (see
|
||||||
|luaref-lua_createtable|).
|
|lua_createtable()|).
|
||||||
|
|
||||||
lua_newthread *lua_newthread()*
|
lua_newthread *lua_newthread()*
|
||||||
>
|
>
|
||||||
lua_State *lua_newthread (lua_State *L);
|
lua_State *lua_newthread (lua_State *L);
|
||||||
<
|
<
|
||||||
Creates a new thread, pushes it on the stack, and returns a pointer to
|
Creates a new thread, pushes it on the stack, and returns a pointer to
|
||||||
a `lua_State` (see |luaref-lua_State|) that represents this new
|
a `lua_State` (see |lua_State()|) that represents this new
|
||||||
thread. The new state returned by this function shares with the
|
thread. The new state returned by this function shares with the
|
||||||
original state all global objects (such as tables), but has an
|
original state all global objects (such as tables), but has an
|
||||||
independent execution stack.
|
independent execution stack.
|
||||||
@@ -2218,7 +2153,7 @@ lua_next *lua_next()*
|
|||||||
}
|
}
|
||||||
<
|
<
|
||||||
While traversing a table, do not call `lua_tolstring` (see
|
While traversing a table, do not call `lua_tolstring` (see
|
||||||
|luaref-lua_tolstring|) directly on a key, unless you know that the
|
|lua_tolstring()|) directly on a key, unless you know that the
|
||||||
key is actually a string. Recall that `lua_tolstring` `changes` the
|
key is actually a string. Recall that `lua_tolstring` `changes` the
|
||||||
value at the given index; this confuses the next call to `lua_next`.
|
value at the given index; this confuses the next call to `lua_next`.
|
||||||
|
|
||||||
@@ -2248,7 +2183,7 @@ lua_pcall *lua_pcall()*
|
|||||||
Calls a function in protected mode.
|
Calls a function in protected mode.
|
||||||
|
|
||||||
Both `nargs` and `nresults` have the same meaning as in `lua_call`
|
Both `nargs` and `nresults` have the same meaning as in `lua_call`
|
||||||
(see |luaref-lua_call|). If there are no errors during the call,
|
(see |lua_call()|). If there are no errors during the call,
|
||||||
`lua_pcall` behaves exactly like `lua_call`. However, if there is any
|
`lua_pcall` behaves exactly like `lua_call`. However, if there is any
|
||||||
error, `lua_pcall` catches it, pushes a single value on the stack (the
|
error, `lua_pcall` catches it, pushes a single value on the stack (the
|
||||||
error message), and returns an error code. Like `lua_call`,
|
error message), and returns an error code. Like `lua_call`,
|
||||||
@@ -2314,7 +2249,7 @@ lua_pushcfunction *lua_pushcfunction()*
|
|||||||
|
|
||||||
Any function to be registered in Lua must follow the correct protocol
|
Any function to be registered in Lua must follow the correct protocol
|
||||||
to receive its parameters and return its results (see
|
to receive its parameters and return its results (see
|
||||||
|luaref-lua_CFunction|).
|
|lua_CFunction()|).
|
||||||
|
|
||||||
`lua_pushcfunction` is defined as a macro:
|
`lua_pushcfunction` is defined as a macro:
|
||||||
>
|
>
|
||||||
@@ -2408,7 +2343,7 @@ lua_pushvfstring *lua_pushvfstring()*
|
|||||||
const char *fmt,
|
const char *fmt,
|
||||||
va_list argp);
|
va_list argp);
|
||||||
<
|
<
|
||||||
Equivalent to `lua_pushfstring` (see |luaref-pushfstring|), except
|
Equivalent to `lua_pushfstring` (see |lua_pushfstring()|), except
|
||||||
that it receives a `va_list` instead of a variable number of
|
that it receives a `va_list` instead of a variable number of
|
||||||
arguments.
|
arguments.
|
||||||
|
|
||||||
@@ -2425,7 +2360,7 @@ lua_rawget *lua_rawget()*
|
|||||||
>
|
>
|
||||||
void lua_rawget (lua_State *L, int index);
|
void lua_rawget (lua_State *L, int index);
|
||||||
<
|
<
|
||||||
Similar to `lua_gettable` (see |luaref-lua_gettable|), but does a raw
|
Similar to `lua_gettable` (see |lua_gettable()|), but does a raw
|
||||||
access (i.e., without metamethods).
|
access (i.e., without metamethods).
|
||||||
|
|
||||||
lua_rawgeti *lua_rawgeti()*
|
lua_rawgeti *lua_rawgeti()*
|
||||||
@@ -2440,7 +2375,7 @@ lua_rawset *lua_rawset()*
|
|||||||
>
|
>
|
||||||
void lua_rawset (lua_State *L, int index);
|
void lua_rawset (lua_State *L, int index);
|
||||||
<
|
<
|
||||||
Similar to `lua_settable` (see |luaref-lua_settable|), but does a raw
|
Similar to `lua_settable` (see |lua_settable()|), but does a raw
|
||||||
assignment (i.e., without metamethods).
|
assignment (i.e., without metamethods).
|
||||||
|
|
||||||
lua_rawseti *lua_rawseti()*
|
lua_rawseti *lua_rawseti()*
|
||||||
@@ -2459,7 +2394,7 @@ lua_Reader *lua_Reader()*
|
|||||||
void *data,
|
void *data,
|
||||||
size_t *size);
|
size_t *size);
|
||||||
<
|
<
|
||||||
The reader function used by `lua_load` (see |luaref-lua_load|). Every
|
The reader function used by `lua_load` (see |lua_load()|). Every
|
||||||
time it needs another piece of the chunk, `lua_load` calls the reader,
|
time it needs another piece of the chunk, `lua_load` calls the reader,
|
||||||
passing along its `data` parameter. The reader must return a pointer
|
passing along its `data` parameter. The reader must return a pointer
|
||||||
to a block of memory with a new piece of the chunk and set `size` to
|
to a block of memory with a new piece of the chunk and set `size` to
|
||||||
@@ -2504,15 +2439,15 @@ lua_resume *lua_resume()*
|
|||||||
Starts and resumes a coroutine in a given thread.
|
Starts and resumes a coroutine in a given thread.
|
||||||
|
|
||||||
To start a coroutine, you first create a new thread (see
|
To start a coroutine, you first create a new thread (see
|
||||||
|luaref-lua_newthread|); then you push onto its stack the main
|
|lua_newthread()|); then you push onto its stack the main
|
||||||
function plus any arguments; then you call `lua_resume` (see
|
function plus any arguments; then you call `lua_resume` (see
|
||||||
|luaref-lua_resume|) with `narg` being the number of arguments. This
|
|lua_resume()|) with `narg` being the number of arguments. This
|
||||||
call returns when the coroutine suspends or finishes its execution.
|
call returns when the coroutine suspends or finishes its execution.
|
||||||
When it returns, the stack contains all values passed to `lua_yield`
|
When it returns, the stack contains all values passed to `lua_yield`
|
||||||
(see |luaref-lua_yield|), or all values returned by the body function.
|
(see |lua_yield()|), or all values returned by the body function.
|
||||||
`lua_resume` returns `LUA_YIELD` if the coroutine yields, 0 if the
|
`lua_resume` returns `LUA_YIELD` if the coroutine yields, 0 if the
|
||||||
coroutine finishes its execution without errors, or an error code in
|
coroutine finishes its execution without errors, or an error code in
|
||||||
case of errors (see |luaref-lua_pcall|). In case of errors, the stack
|
case of errors (see |lua_pcall()|). In case of errors, the stack
|
||||||
is not unwound, so you can use the debug API over it. The error
|
is not unwound, so you can use the debug API over it. The error
|
||||||
message is on the top of the stack. To restart a coroutine, you put on
|
message is on the top of the stack. To restart a coroutine, you put on
|
||||||
its stack only the values to be passed as results from `lua_yield`,
|
its stack only the values to be passed as results from `lua_yield`,
|
||||||
@@ -2593,7 +2528,7 @@ lua_State *lua_State()*
|
|||||||
|
|
||||||
A pointer to this state must be passed as the first argument to every
|
A pointer to this state must be passed as the first argument to every
|
||||||
function in the library, except to `lua_newstate` (see
|
function in the library, except to `lua_newstate` (see
|
||||||
|luaref-lua_newstate|), which creates a Lua state from scratch.
|
|lua_newstate()|), which creates a Lua state from scratch.
|
||||||
|
|
||||||
lua_status *lua_status()*
|
lua_status *lua_status()*
|
||||||
>
|
>
|
||||||
@@ -2614,7 +2549,7 @@ lua_toboolean *lua_toboolean()*
|
|||||||
any Lua value different from `false` and `nil`; otherwise it returns
|
any Lua value different from `false` and `nil`; otherwise it returns
|
||||||
0. It also returns 0 when called with a non-valid index. (If you want
|
0. It also returns 0 when called with a non-valid index. (If you want
|
||||||
to accept only actual boolean values, use `lua_isboolean`
|
to accept only actual boolean values, use `lua_isboolean`
|
||||||
|luaref-lua_isboolean| to test the value's type.)
|
|lua_isboolean()| to test the value's type.)
|
||||||
|
|
||||||
lua_tocfunction *lua_tocfunction()*
|
lua_tocfunction *lua_tocfunction()*
|
||||||
>
|
>
|
||||||
@@ -2628,7 +2563,7 @@ lua_tointeger *lua_tointeger()*
|
|||||||
lua_Integer lua_tointeger (lua_State *L, int idx);
|
lua_Integer lua_tointeger (lua_State *L, int idx);
|
||||||
<
|
<
|
||||||
Converts the Lua value at the given acceptable index to the signed
|
Converts the Lua value at the given acceptable index to the signed
|
||||||
integral type `lua_Integer` (see |luaref-lua_Integer|). The Lua value
|
integral type `lua_Integer` (see |lua_Integer()|). The Lua value
|
||||||
must be a number or a string convertible to a number (see
|
must be a number or a string convertible to a number (see
|
||||||
|luaref-langCoercion|); otherwise, `lua_tointeger` returns 0.
|
|luaref-langCoercion|); otherwise, `lua_tointeger` returns 0.
|
||||||
|
|
||||||
@@ -2644,7 +2579,7 @@ lua_tolstring *lua_tolstring()*
|
|||||||
Lua value must be a string or a number; otherwise, the function
|
Lua value must be a string or a number; otherwise, the function
|
||||||
returns `NULL`. If the value is a number, then `lua_tolstring` also
|
returns `NULL`. If the value is a number, then `lua_tolstring` also
|
||||||
`changes the actual value in the stack to a` `string`. (This change
|
`changes the actual value in the stack to a` `string`. (This change
|
||||||
confuses `lua_next` |luaref-lua_next| when `lua_tolstring` is applied
|
confuses `lua_next` |lua_next()| when `lua_tolstring` is applied
|
||||||
to keys during a table traversal.)
|
to keys during a table traversal.)
|
||||||
|
|
||||||
`lua_tolstring` returns a fully aligned pointer to a string inside the
|
`lua_tolstring` returns a fully aligned pointer to a string inside the
|
||||||
@@ -2659,7 +2594,7 @@ lua_tonumber *lua_tonumber()*
|
|||||||
lua_Number lua_tonumber (lua_State *L, int index);
|
lua_Number lua_tonumber (lua_State *L, int index);
|
||||||
<
|
<
|
||||||
Converts the Lua value at the given acceptable index to the C type
|
Converts the Lua value at the given acceptable index to the C type
|
||||||
`lua_Number` (see |luaref-lua_Number|). The Lua value must be a number
|
`lua_Number` (see |lua_Number()|). The Lua value must be a number
|
||||||
or a string convertible to a number (see |luaref-langCoercion|);
|
or a string convertible to a number (see |luaref-langCoercion|);
|
||||||
otherwise, `lua_tonumber` returns 0.
|
otherwise, `lua_tonumber` returns 0.
|
||||||
|
|
||||||
@@ -2679,7 +2614,7 @@ lua_tostring *lua_tostring()*
|
|||||||
>
|
>
|
||||||
const char *lua_tostring (lua_State *L, int index);
|
const char *lua_tostring (lua_State *L, int index);
|
||||||
<
|
<
|
||||||
Equivalent to `lua_tolstring` (see |luaref-lua_tolstring|) with `len`
|
Equivalent to `lua_tolstring` (see |lua_tolstring()|) with `len`
|
||||||
equal to `NULL`.
|
equal to `NULL`.
|
||||||
|
|
||||||
lua_tothread *lua_tothread()*
|
lua_tothread *lua_tothread()*
|
||||||
@@ -2687,7 +2622,7 @@ lua_tothread *lua_tothread()*
|
|||||||
lua_State *lua_tothread (lua_State *L, int index);
|
lua_State *lua_tothread (lua_State *L, int index);
|
||||||
<
|
<
|
||||||
Converts the value at the given acceptable index to a Lua thread
|
Converts the value at the given acceptable index to a Lua thread
|
||||||
(represented as `lua_State*` |luaref-lua_State|). This value must be a
|
(represented as `lua_State*` |lua_State()|). This value must be a
|
||||||
thread; otherwise, the function returns `NULL`.
|
thread; otherwise, the function returns `NULL`.
|
||||||
|
|
||||||
lua_touserdata *lua_touserdata()*
|
lua_touserdata *lua_touserdata()*
|
||||||
@@ -2723,7 +2658,7 @@ lua_Writer *lua_Writer()*
|
|||||||
size_t sz,
|
size_t sz,
|
||||||
void* ud);
|
void* ud);
|
||||||
<
|
<
|
||||||
The writer function used by `lua_dump` (see |luaref-lua_dump|). Every
|
The writer function used by `lua_dump` (see |lua_dump()|). Every
|
||||||
time it produces another piece of chunk, `lua_dump` calls the writer,
|
time it produces another piece of chunk, `lua_dump` calls the writer,
|
||||||
passing along the buffer to be written (`p`), its size (`sz`), and the
|
passing along the buffer to be written (`p`), its size (`sz`), and the
|
||||||
`data` parameter supplied to `lua_dump`.
|
`data` parameter supplied to `lua_dump`.
|
||||||
@@ -2753,7 +2688,7 @@ lua_yield *lua_yield()*
|
|||||||
<
|
<
|
||||||
When a C function calls `lua_yield` in that way, the running coroutine
|
When a C function calls `lua_yield` in that way, the running coroutine
|
||||||
suspends its execution, and the call to `lua_resume` (see
|
suspends its execution, and the call to `lua_resume` (see
|
||||||
|luaref-lua_resume|) that started this coroutine returns. The
|
|lua_resume()|) that started this coroutine returns. The
|
||||||
parameter `nresults` is the number of values from the stack that are
|
parameter `nresults` is the number of values from the stack that are
|
||||||
passed as results to `lua_resume`.
|
passed as results to `lua_resume`.
|
||||||
|
|
||||||
@@ -2798,9 +2733,9 @@ lua_Debug *lua_Debug()*
|
|||||||
`} lua_Debug;`
|
`} lua_Debug;`
|
||||||
|
|
||||||
A structure used to carry different pieces of information about an active
|
A structure used to carry different pieces of information about an active
|
||||||
function. `lua_getstack` (see |luaref-lua_getstack|) fills only the private part
|
function. `lua_getstack` (see |lua_getstack()|) fills only the private part
|
||||||
of this structure, for later use. To fill the other fields of `lua_Debug` with
|
of this structure, for later use. To fill the other fields of `lua_Debug` with
|
||||||
useful information, call `lua_getinfo` (see |luaref-lua_getinfo|).
|
useful information, call `lua_getinfo` (see |lua_getinfo()|).
|
||||||
|
|
||||||
The fields of `lua_Debug` have the following meaning:
|
The fields of `lua_Debug` have the following meaning:
|
||||||
|
|
||||||
@@ -2858,8 +2793,8 @@ lua_getinfo *lua_getinfo()*
|
|||||||
|
|
||||||
To get information about a function invocation, the parameter `ar`
|
To get information about a function invocation, the parameter `ar`
|
||||||
must be a valid activation record that was filled by a previous call
|
must be a valid activation record that was filled by a previous call
|
||||||
to `lua_getstack` (see |luaref-lua_getstack|) or given as argument to
|
to `lua_getstack` (see |lua_getstack()|) or given as argument to
|
||||||
a hook (see |luaref-lua_Hook|).
|
a hook (see |lua_Hook()|).
|
||||||
|
|
||||||
To get information about a function you push it onto the stack and
|
To get information about a function you push it onto the stack and
|
||||||
start the `what` string with the character `>`. (In that case,
|
start the `what` string with the character `>`. (In that case,
|
||||||
@@ -2896,8 +2831,8 @@ lua_getlocal *lua_getlocal()*
|
|||||||
<
|
<
|
||||||
Gets information about a local variable of a given activation record.
|
Gets information about a local variable of a given activation record.
|
||||||
The parameter `ar` must be a valid activation record that was filled
|
The parameter `ar` must be a valid activation record that was filled
|
||||||
by a previous call to `lua_getstack` (see |luaref-lua_getstack|) or
|
by a previous call to `lua_getstack` (see |lua_getstack()|) or
|
||||||
given as argument to a hook (see |luaref-lua_Hook|). The index `n`
|
given as argument to a hook (see |lua_Hook()|). The index `n`
|
||||||
selects which local variable to inspect (1 is the first parameter or
|
selects which local variable to inspect (1 is the first parameter or
|
||||||
active local variable, and so on, until the last active local
|
active local variable, and so on, until the last active local
|
||||||
variable). `lua_getlocal` pushes the variable's value onto the stack
|
variable). `lua_getlocal` pushes the variable's value onto the stack
|
||||||
@@ -2916,7 +2851,7 @@ lua_getstack *lua_getstack()*
|
|||||||
<
|
<
|
||||||
Gets information about the interpreter runtime stack.
|
Gets information about the interpreter runtime stack.
|
||||||
|
|
||||||
This function fills parts of a `lua_Debug` (see |luaref-lua_Debug|)
|
This function fills parts of a `lua_Debug` (see |lua_Debug()|)
|
||||||
structure with an identification of the `activation record` of the
|
structure with an identification of the `activation record` of the
|
||||||
function executing at a given level. Level 0 is the current running
|
function executing at a given level. Level 0 is the current running
|
||||||
function, whereas level `n+1` is the function that has called level
|
function, whereas level `n+1` is the function that has called level
|
||||||
@@ -2951,7 +2886,7 @@ lua_Hook *lua_Hook()*
|
|||||||
`LUA_HOOKTAILRET`, `LUA_HOOKLINE`, and `LUA_HOOKCOUNT`. Moreover, for
|
`LUA_HOOKTAILRET`, `LUA_HOOKLINE`, and `LUA_HOOKCOUNT`. Moreover, for
|
||||||
line events, the field `currentline` is also set. To get the value of
|
line events, the field `currentline` is also set. To get the value of
|
||||||
any other field in `ar`, the hook must call `lua_getinfo` (see
|
any other field in `ar`, the hook must call `lua_getinfo` (see
|
||||||
|luaref-lua_getinfo|). For return events, `event` may be
|
|lua_getinfo()|). For return events, `event` may be
|
||||||
`LUA_HOOKRET`, the normal value, or `LUA_HOOKTAILRET`. In the latter
|
`LUA_HOOKRET`, the normal value, or `LUA_HOOKTAILRET`. In the latter
|
||||||
case, Lua is simulating a return from a function that did a tail call;
|
case, Lua is simulating a return from a function that did a tail call;
|
||||||
in this case, it is useless to call `lua_getinfo`.
|
in this case, it is useless to call `lua_getinfo`.
|
||||||
@@ -2996,7 +2931,7 @@ lua_setlocal *lua_setlocal()*
|
|||||||
<
|
<
|
||||||
Sets the value of a local variable of a given activation record.
|
Sets the value of a local variable of a given activation record.
|
||||||
Parameters `ar` and `n` are as in `lua_getlocal` (see
|
Parameters `ar` and `n` are as in `lua_getlocal` (see
|
||||||
|luaref-lua_getlocal|). `lua_setlocal` assigns the value at the top of
|
|lua_getlocal()|). `lua_setlocal` assigns the value at the top of
|
||||||
the stack to the variable and returns its name. It also pops the value
|
the stack to the variable and returns its name. It also pops the value
|
||||||
from the stack.
|
from the stack.
|
||||||
|
|
||||||
@@ -3010,7 +2945,7 @@ lua_setupvalue *lua_setupvalue()*
|
|||||||
Sets the value of a closure's upvalue. It assigns the value at the top
|
Sets the value of a closure's upvalue. It assigns the value at the top
|
||||||
of the stack to the upvalue and returns its name. It also pops the
|
of the stack to the upvalue and returns its name. It also pops the
|
||||||
value from the stack. Parameters `funcindex` and `n` are as in the
|
value from the stack. Parameters `funcindex` and `n` are as in the
|
||||||
`lua_getupvalue` (see |luaref-lua_getupvalue|).
|
`lua_getupvalue` (see |lua_getupvalue()|).
|
||||||
|
|
||||||
Returns `NULL` (and pops nothing) when the index is greater than the
|
Returns `NULL` (and pops nothing) when the index is greater than the
|
||||||
number of upvalues.
|
number of upvalues.
|
||||||
@@ -3071,36 +3006,36 @@ luaL_addchar *luaL_addchar()*
|
|||||||
>
|
>
|
||||||
void luaL_addchar (luaL_Buffer *B, char c);
|
void luaL_addchar (luaL_Buffer *B, char c);
|
||||||
<
|
<
|
||||||
Adds the character `c` to the buffer `B` (see |luaref-luaL_Buffer|).
|
Adds the character `c` to the buffer `B` (see |luaL_Buffer()|).
|
||||||
|
|
||||||
luaL_addlstring *luaL_addlstring()*
|
luaL_addlstring *luaL_addlstring()*
|
||||||
>
|
>
|
||||||
void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l);
|
void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l);
|
||||||
<
|
<
|
||||||
Adds the string pointed to by `s` with length `l` to the buffer `B`
|
Adds the string pointed to by `s` with length `l` to the buffer `B`
|
||||||
(see |luaref-luaL_Buffer|). The string may contain embedded zeros.
|
(see |luaL_Buffer()|). The string may contain embedded zeros.
|
||||||
|
|
||||||
luaL_addsize *luaL_addsize()*
|
luaL_addsize *luaL_addsize()*
|
||||||
>
|
>
|
||||||
void luaL_addsize (luaL_Buffer *B, size_t n);
|
void luaL_addsize (luaL_Buffer *B, size_t n);
|
||||||
<
|
<
|
||||||
Adds to the buffer `B` (see |luaref-luaL_Buffer|) a string of length
|
Adds to the buffer `B` (see |luaL_Buffer()|) a string of length
|
||||||
`n` previously copied to the buffer area (see
|
`n` previously copied to the buffer area (see
|
||||||
|luaref-luaL_prepbuffer|).
|
|luaL_prepbuffer()|).
|
||||||
|
|
||||||
luaL_addstring *luaL_addstring()*
|
luaL_addstring *luaL_addstring()*
|
||||||
>
|
>
|
||||||
void luaL_addstring (luaL_Buffer *B, const char *s);
|
void luaL_addstring (luaL_Buffer *B, const char *s);
|
||||||
<
|
<
|
||||||
Adds the zero-terminated string pointed to by `s` to the buffer `B`
|
Adds the zero-terminated string pointed to by `s` to the buffer `B`
|
||||||
(see |luaref-luaL_Buffer|). The string may not contain embedded zeros.
|
(see |luaL_Buffer()|). The string may not contain embedded zeros.
|
||||||
|
|
||||||
luaL_addvalue *luaL_addvalue()*
|
luaL_addvalue *luaL_addvalue()*
|
||||||
>
|
>
|
||||||
void luaL_addvalue (luaL_Buffer *B);
|
void luaL_addvalue (luaL_Buffer *B);
|
||||||
<
|
<
|
||||||
Adds the value at the top of the stack to the buffer `B` (see
|
Adds the value at the top of the stack to the buffer `B` (see
|
||||||
|luaref-luaL_Buffer|). Pops the value.
|
|luaL_Buffer()|). Pops the value.
|
||||||
|
|
||||||
This is the only function on string buffers that can (and must) be
|
This is the only function on string buffers that can (and must) be
|
||||||
called with an extra element on the stack, which is the value to be
|
called with an extra element on the stack, which is the value to be
|
||||||
@@ -3142,11 +3077,11 @@ luaL_Buffer *luaL_Buffer()*
|
|||||||
|
|
||||||
- First you declare a variable `b` of type `luaL_Buffer`.
|
- First you declare a variable `b` of type `luaL_Buffer`.
|
||||||
- Then you initialize it with a call `luaL_buffinit(L, &b)` (see
|
- Then you initialize it with a call `luaL_buffinit(L, &b)` (see
|
||||||
|luaref-luaL_buffinit|).
|
|luaL_buffinit()|).
|
||||||
- Then you add string pieces to the buffer calling any of the
|
- Then you add string pieces to the buffer calling any of the
|
||||||
`luaL_add*` functions.
|
`luaL_add*` functions.
|
||||||
- You finish by calling `luaL_pushresult(&b)` (see
|
- You finish by calling `luaL_pushresult(&b)` (see
|
||||||
|luaref-luaL_pushresult|). This call leaves the final string on the
|
|luaL_pushresult()|). This call leaves the final string on the
|
||||||
top of the stack.
|
top of the stack.
|
||||||
|
|
||||||
During its normal operation, a string buffer uses a variable number of
|
During its normal operation, a string buffer uses a variable number of
|
||||||
@@ -3156,7 +3091,7 @@ luaL_Buffer *luaL_Buffer()*
|
|||||||
that is, when you call a buffer operation, the stack is at the same
|
that is, when you call a buffer operation, the stack is at the same
|
||||||
level it was immediately after the previous buffer operation. (The
|
level it was immediately after the previous buffer operation. (The
|
||||||
only exception to this rule is `luaL_addvalue`
|
only exception to this rule is `luaL_addvalue`
|
||||||
|luaref-luaL_addvalue|.) After calling `luaL_pushresult` the stack is
|
|luaL_addvalue()|.) After calling `luaL_pushresult` the stack is
|
||||||
back to its level when the buffer was initialized, plus the final
|
back to its level when the buffer was initialized, plus the final
|
||||||
string on its top.
|
string on its top.
|
||||||
|
|
||||||
@@ -3165,7 +3100,7 @@ luaL_buffinit *luaL_buffinit()*
|
|||||||
void luaL_buffinit (lua_State *L, luaL_Buffer *B);
|
void luaL_buffinit (lua_State *L, luaL_Buffer *B);
|
||||||
<
|
<
|
||||||
Initializes a buffer `B`. This function does not allocate any space;
|
Initializes a buffer `B`. This function does not allocate any space;
|
||||||
the buffer must be declared as a variable (see |luaref-luaL_Buffer|).
|
the buffer must be declared as a variable (see |luaL_Buffer()|).
|
||||||
|
|
||||||
luaL_callmeta *luaL_callmeta()*
|
luaL_callmeta *luaL_callmeta()*
|
||||||
>
|
>
|
||||||
@@ -3199,7 +3134,7 @@ luaL_checkinteger *luaL_checkinteger()*
|
|||||||
lua_Integer luaL_checkinteger (lua_State *L, int narg);
|
lua_Integer luaL_checkinteger (lua_State *L, int narg);
|
||||||
<
|
<
|
||||||
Checks whether the function argument `narg` is a number and returns
|
Checks whether the function argument `narg` is a number and returns
|
||||||
this number cast to a `lua_Integer` (see |luaref-lua_Integer|).
|
this number cast to a `lua_Integer` (see |lua_Integer()|).
|
||||||
|
|
||||||
luaL_checklong *luaL_checklong()*
|
luaL_checklong *luaL_checklong()*
|
||||||
>
|
>
|
||||||
@@ -3220,7 +3155,7 @@ luaL_checknumber *luaL_checknumber()*
|
|||||||
lua_Number luaL_checknumber (lua_State *L, int narg);
|
lua_Number luaL_checknumber (lua_State *L, int narg);
|
||||||
<
|
<
|
||||||
Checks whether the function argument `narg` is a number and returns
|
Checks whether the function argument `narg` is a number and returns
|
||||||
this number (see |luaref-lua_Number|).
|
this number (see |lua_Number()|).
|
||||||
|
|
||||||
luaL_checkoption *luaL_checkoption()*
|
luaL_checkoption *luaL_checkoption()*
|
||||||
>
|
>
|
||||||
@@ -3262,14 +3197,14 @@ luaL_checktype *luaL_checktype()*
|
|||||||
void luaL_checktype (lua_State *L, int narg, int t);
|
void luaL_checktype (lua_State *L, int narg, int t);
|
||||||
<
|
<
|
||||||
Checks whether the function argument `narg` has type `t` (see
|
Checks whether the function argument `narg` has type `t` (see
|
||||||
|luaref-lua_type|).
|
|lua_type()|).
|
||||||
|
|
||||||
luaL_checkudata *luaL_checkudata()*
|
luaL_checkudata *luaL_checkudata()*
|
||||||
>
|
>
|
||||||
void *luaL_checkudata (lua_State *L, int narg, const char *tname);
|
void *luaL_checkudata (lua_State *L, int narg, const char *tname);
|
||||||
<
|
<
|
||||||
Checks whether the function argument `narg` is a userdata of the type
|
Checks whether the function argument `narg` is a userdata of the type
|
||||||
`tname` (see |luaref-luaL_newmetatable|).
|
`tname` (see |luaL_newmetatable()|).
|
||||||
|
|
||||||
luaL_dofile *luaL_dofile()*
|
luaL_dofile *luaL_dofile()*
|
||||||
>
|
>
|
||||||
@@ -3297,7 +3232,7 @@ luaL_error *luaL_error()*
|
|||||||
<
|
<
|
||||||
Raises an error. The error message format is given by `fmt` plus any
|
Raises an error. The error message format is given by `fmt` plus any
|
||||||
extra arguments, following the same rules of `lua_pushfstring` (see
|
extra arguments, following the same rules of `lua_pushfstring` (see
|
||||||
|luaref-lua_pushfstring|). It also adds at the beginning of the
|
|lua_pushfstring()|). It also adds at the beginning of the
|
||||||
message the file name and the line number where the error occurred, if
|
message the file name and the line number where the error occurred, if
|
||||||
this information is available.
|
this information is available.
|
||||||
|
|
||||||
@@ -3317,7 +3252,7 @@ luaL_getmetatable *luaL_getmetatable()*
|
|||||||
void luaL_getmetatable (lua_State *L, const char *tname);
|
void luaL_getmetatable (lua_State *L, const char *tname);
|
||||||
<
|
<
|
||||||
Pushes onto the stack the metatable associated with name `tname` in
|
Pushes onto the stack the metatable associated with name `tname` in
|
||||||
the registry (see |luaref-luaL_newmetatable|).
|
the registry (see |luaL_newmetatable()|).
|
||||||
|
|
||||||
luaL_gsub *luaL_gsub()*
|
luaL_gsub *luaL_gsub()*
|
||||||
>
|
>
|
||||||
@@ -3338,7 +3273,7 @@ luaL_loadbuffer *luaL_loadbuffer()*
|
|||||||
const char *name);
|
const char *name);
|
||||||
<
|
<
|
||||||
Loads a buffer as a Lua chunk. This function uses `lua_load` (see
|
Loads a buffer as a Lua chunk. This function uses `lua_load` (see
|
||||||
|luaref-lua_load|) to load the chunk in the buffer pointed to by
|
|lua_load()|) to load the chunk in the buffer pointed to by
|
||||||
`buff` with size `sz`.
|
`buff` with size `sz`.
|
||||||
|
|
||||||
This function returns the same results as `lua_load`. `name` is the
|
This function returns the same results as `lua_load`. `name` is the
|
||||||
@@ -3349,7 +3284,7 @@ luaL_loadfile *luaL_loadfile()*
|
|||||||
int luaL_loadfile (lua_State *L, const char *filename);
|
int luaL_loadfile (lua_State *L, const char *filename);
|
||||||
<
|
<
|
||||||
Loads a file as a Lua chunk. This function uses `lua_load` (see
|
Loads a file as a Lua chunk. This function uses `lua_load` (see
|
||||||
|luaref-lua_load|) to load the chunk in the file named `filename`. If
|
|lua_load()|) to load the chunk in the file named `filename`. If
|
||||||
`filename` is `NULL`, then it loads from the standard input. The first
|
`filename` is `NULL`, then it loads from the standard input. The first
|
||||||
line in the file is ignored if it starts with a `#`.
|
line in the file is ignored if it starts with a `#`.
|
||||||
|
|
||||||
@@ -3363,7 +3298,7 @@ luaL_loadstring *luaL_loadstring()*
|
|||||||
int luaL_loadstring (lua_State *L, const char *s);
|
int luaL_loadstring (lua_State *L, const char *s);
|
||||||
<
|
<
|
||||||
Loads a string as a Lua chunk. This function uses `lua_load` (see
|
Loads a string as a Lua chunk. This function uses `lua_load` (see
|
||||||
|luaref-lua_load|) to load the chunk in the zero-terminated string
|
|lua_load()|) to load the chunk in the zero-terminated string
|
||||||
`s`.
|
`s`.
|
||||||
|
|
||||||
This function returns the same results as `lua_load`.
|
This function returns the same results as `lua_load`.
|
||||||
@@ -3387,9 +3322,9 @@ luaL_newstate *luaL_newstate()*
|
|||||||
lua_State *luaL_newstate (void);
|
lua_State *luaL_newstate (void);
|
||||||
<
|
<
|
||||||
Creates a new Lua state. It calls `lua_newstate` (see
|
Creates a new Lua state. It calls `lua_newstate` (see
|
||||||
|luaref-lua_newstate|) with an allocator based on the standard C
|
|lua_newstate()|) with an allocator based on the standard C
|
||||||
`realloc` function and then sets a panic function (see
|
`realloc` function and then sets a panic function (see
|
||||||
|luaref-lua_atpanic|) that prints an error message to the standard
|
|lua_atpanic()|) that prints an error message to the standard
|
||||||
error output in case of fatal errors.
|
error output in case of fatal errors.
|
||||||
|
|
||||||
Returns the new state, or `NULL` if there is a memory allocation
|
Returns the new state, or `NULL` if there is a memory allocation
|
||||||
@@ -3417,7 +3352,7 @@ luaL_optinteger *luaL_optinteger()*
|
|||||||
lua_Integer d);
|
lua_Integer d);
|
||||||
<
|
<
|
||||||
If the function argument `narg` is a number, returns this number cast
|
If the function argument `narg` is a number, returns this number cast
|
||||||
to a `lua_Integer` (see |luaref-lua_Integer|). If this argument is
|
to a `lua_Integer` (see |lua_Integer()|). If this argument is
|
||||||
absent or is `nil`, returns `d`. Otherwise, raises an error.
|
absent or is `nil`, returns `d`. Otherwise, raises an error.
|
||||||
|
|
||||||
luaL_optlong *luaL_optlong()*
|
luaL_optlong *luaL_optlong()*
|
||||||
@@ -3464,9 +3399,9 @@ luaL_prepbuffer *luaL_prepbuffer()*
|
|||||||
char *luaL_prepbuffer (luaL_Buffer *B);
|
char *luaL_prepbuffer (luaL_Buffer *B);
|
||||||
<
|
<
|
||||||
Returns an address to a space of size `LUAL_BUFFERSIZE` where you can
|
Returns an address to a space of size `LUAL_BUFFERSIZE` where you can
|
||||||
copy a string to be added to buffer `B` (see |luaref-luaL_Buffer|).
|
copy a string to be added to buffer `B` (see |luaL_Buffer()|).
|
||||||
After copying the string into this space you must call `luaL_addsize`
|
After copying the string into this space you must call `luaL_addsize`
|
||||||
(see |luaref-luaL_addsize|) with the size of the string to actually
|
(see |luaL_addsize()|) with the size of the string to actually
|
||||||
add it to the buffer.
|
add it to the buffer.
|
||||||
|
|
||||||
luaL_pushresult *luaL_pushresult()*
|
luaL_pushresult *luaL_pushresult()*
|
||||||
@@ -3486,8 +3421,8 @@ luaL_ref *luaL_ref()*
|
|||||||
A reference is a unique integer key. As long as you do not manually
|
A reference is a unique integer key. As long as you do not manually
|
||||||
add integer keys into table `t`, `luaL_ref` ensures the uniqueness of
|
add integer keys into table `t`, `luaL_ref` ensures the uniqueness of
|
||||||
the key it returns. You can retrieve an object referred by reference
|
the key it returns. You can retrieve an object referred by reference
|
||||||
`r` by calling `lua_rawgeti(L, t, r)` (see |luaref-lua_rawgeti|).
|
`r` by calling `lua_rawgeti(L, t, r)` (see |lua_rawgeti()|).
|
||||||
Function `luaL_unref` (see |luaref-luaL_unref|) frees a reference and
|
Function `luaL_unref` (see |luaL_unref()|) frees a reference and
|
||||||
its associated object.
|
its associated object.
|
||||||
|
|
||||||
If the object at the top of the stack is `nil`, `luaL_ref` returns the
|
If the object at the top of the stack is `nil`, `luaL_ref` returns the
|
||||||
@@ -3502,7 +3437,7 @@ luaL_Reg *luaL_Reg()*
|
|||||||
} luaL_Reg;
|
} luaL_Reg;
|
||||||
<
|
<
|
||||||
Type for arrays of functions to be registered by `luaL_register` (see
|
Type for arrays of functions to be registered by `luaL_register` (see
|
||||||
|luaref-luaL_register|). `name` is the function name and `func` is a
|
|luaL_register()|). `name` is the function name and `func` is a
|
||||||
pointer to the function. Any array of `luaL_Reg` must end with a
|
pointer to the function. Any array of `luaL_Reg` must end with a
|
||||||
sentinel entry in which both `name` and `func` are `NULL`.
|
sentinel entry in which both `name` and `func` are `NULL`.
|
||||||
|
|
||||||
@@ -3515,7 +3450,7 @@ luaL_register *luaL_register()*
|
|||||||
Opens a library.
|
Opens a library.
|
||||||
|
|
||||||
When called with `libname` equal to `NULL`, it simply registers all
|
When called with `libname` equal to `NULL`, it simply registers all
|
||||||
functions in the list `l` (see |luaref-luaL_Reg|) into the table on
|
functions in the list `l` (see |luaL_Reg()|) into the table on
|
||||||
the top of the stack.
|
the top of the stack.
|
||||||
|
|
||||||
When called with a non-null `libname`, `luaL_register` creates a new
|
When called with a non-null `libname`, `luaL_register` creates a new
|
||||||
@@ -3543,7 +3478,7 @@ luaL_typerror *luaL_typerror()*
|
|||||||
`expected, got` `rt` `)`
|
`expected, got` `rt` `)`
|
||||||
|
|
||||||
where `location` is produced by `luaL_where` (see
|
where `location` is produced by `luaL_where` (see
|
||||||
|luaref-luaL_where|), `func` is the name of the current function, and
|
|luaL_where()|), `func` is the name of the current function, and
|
||||||
`rt` is the type name of the actual argument.
|
`rt` is the type name of the actual argument.
|
||||||
|
|
||||||
luaL_unref *luaL_unref()*
|
luaL_unref *luaL_unref()*
|
||||||
@@ -3551,7 +3486,7 @@ luaL_unref *luaL_unref()*
|
|||||||
void luaL_unref (lua_State *L, int t, int ref);
|
void luaL_unref (lua_State *L, int t, int ref);
|
||||||
<
|
<
|
||||||
Releases reference `ref` from the table at index `t` (see
|
Releases reference `ref` from the table at index `t` (see
|
||||||
|luaref-luaL_ref|). The entry is removed from the table, so that the
|
|luaL_ref()|). The entry is removed from the table, so that the
|
||||||
referred object can be collected. The reference `ref` is also freed to
|
referred object can be collected. The reference `ref` is also freed to
|
||||||
be used again.
|
be used again.
|
||||||
|
|
||||||
@@ -3601,14 +3536,14 @@ functions as fields of a global table or as methods of its objects.
|
|||||||
*luaref-openlibs*
|
*luaref-openlibs*
|
||||||
To have access to these libraries, the C host program should call the
|
To have access to these libraries, the C host program should call the
|
||||||
`luaL_openlibs` function, which opens all standard libraries (see
|
`luaL_openlibs` function, which opens all standard libraries (see
|
||||||
|luaref-luaL_openlibs|). Alternatively, the host program can open the libraries
|
|luaL_openlibs()|). Alternatively, the host program can open the libraries
|
||||||
individually by calling `luaopen_base` (for the basic library),
|
individually by calling `luaopen_base` (for the basic library),
|
||||||
`luaopen_package` (for the package library), `luaopen_string` (for the string
|
`luaopen_package` (for the package library), `luaopen_string` (for the string
|
||||||
library), `luaopen_table` (for the table library), `luaopen_math` (for the
|
library), `luaopen_table` (for the table library), `luaopen_math` (for the
|
||||||
mathematical library), `luaopen_io` (for the I/O and the Operating System
|
mathematical library), `luaopen_io` (for the I/O and the Operating System
|
||||||
libraries), and `luaopen_debug` (for the debug library). These functions are
|
libraries), and `luaopen_debug` (for the debug library). These functions are
|
||||||
declared in `lualib.h` and should not be called directly: you must call them
|
declared in `lualib.h` and should not be called directly: you must call them
|
||||||
like any other Lua C function, e.g., by using `lua_call` (see |luaref-lua_call|).
|
like any other Lua C function, e.g., by using `lua_call` (see |lua_call()|).
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
5.1 Basic Functions *luaref-libBasic*
|
5.1 Basic Functions *luaref-libBasic*
|
||||||
@@ -3700,11 +3635,11 @@ load({func} [, {chunkname}]) *luaref-load()*
|
|||||||
information.
|
information.
|
||||||
|
|
||||||
loadfile([{filename}]) *luaref-loadfile()*
|
loadfile([{filename}]) *luaref-loadfile()*
|
||||||
Similar to `load` (see |luaref-load|), but gets the chunk from file
|
Similar to `load` (see |luaref-load()|), but gets the chunk from file
|
||||||
{filename} or from the standard input, if no file name is given.
|
{filename} or from the standard input, if no file name is given.
|
||||||
|
|
||||||
loadstring({string} [, {chunkname}]) *luaref-loadstring()*
|
loadstring({string} [, {chunkname}]) *luaref-loadstring()*
|
||||||
Similar to `load` (see |luaref-load|), but gets the chunk from the
|
Similar to `load` (see |luaref-load()|), but gets the chunk from the
|
||||||
given {string}.
|
given {string}.
|
||||||
|
|
||||||
To load and run a given string, use the idiom
|
To load and run a given string, use the idiom
|
||||||
@@ -3724,14 +3659,14 @@ next({table} [, {index}]) *luaref-next()*
|
|||||||
|
|
||||||
The order in which the indices are enumerated is not specified, `even
|
The order in which the indices are enumerated is not specified, `even
|
||||||
for` `numeric indices`. (To traverse a table in numeric order, use a
|
for` `numeric indices`. (To traverse a table in numeric order, use a
|
||||||
numerical `for` or the `ipairs` |luaref-ipairs| function.)
|
numerical `for` or the `ipairs` |luaref-ipairs()| function.)
|
||||||
|
|
||||||
The behavior of `next` is `undefined` if, during the traversal, you
|
The behavior of `next` is `undefined` if, during the traversal, you
|
||||||
assign any value to a non-existent field in the table. You may however
|
assign any value to a non-existent field in the table. You may however
|
||||||
modify existing fields. In particular, you may clear existing fields.
|
modify existing fields. In particular, you may clear existing fields.
|
||||||
|
|
||||||
pairs({t}) *luaref-pairs()*
|
pairs({t}) *luaref-pairs()*
|
||||||
Returns three values: the `next` |luaref-next| function, the table
|
Returns three values: the `next` |luaref-next()| function, the table
|
||||||
{t}, and `nil`, so that the construction
|
{t}, and `nil`, so that the construction
|
||||||
|
|
||||||
`for k,v in pairs(t) do` `body` `end`
|
`for k,v in pairs(t) do` `body` `end`
|
||||||
@@ -3749,10 +3684,10 @@ pcall({f}, {arg1}, {...}) *luaref-pcall()*
|
|||||||
|
|
||||||
print({...}) *luaref-print()*
|
print({...}) *luaref-print()*
|
||||||
Receives any number of arguments, and prints their values to `stdout`,
|
Receives any number of arguments, and prints their values to `stdout`,
|
||||||
using the `tostring` |luaref-tostring| function to convert them to
|
using the `tostring` |luaref-tostring()| function to convert them to
|
||||||
strings. `print` is not intended for formatted output, but only as a
|
strings. `print` is not intended for formatted output, but only as a
|
||||||
quick way to show a value, typically for debugging. For formatted
|
quick way to show a value, typically for debugging. For formatted
|
||||||
output, use `string.format` (see |luaref-string.format|).
|
output, use `string.format` (see |string.format()|).
|
||||||
|
|
||||||
rawequal({v1}, {v2}) *luaref-rawequal()*
|
rawequal({v1}, {v2}) *luaref-rawequal()*
|
||||||
Checks whether {v1} is equal to {v2}, without invoking any metamethod.
|
Checks whether {v1} is equal to {v2}, without invoking any metamethod.
|
||||||
@@ -3807,7 +3742,7 @@ tonumber({e} [, {base}]) *luaref-tonumber()*
|
|||||||
tostring({e}) *luaref-tostring()*
|
tostring({e}) *luaref-tostring()*
|
||||||
Receives an argument of any type and converts it to a string in a
|
Receives an argument of any type and converts it to a string in a
|
||||||
reasonable format. For complete control of how numbers are converted,
|
reasonable format. For complete control of how numbers are converted,
|
||||||
use `string.format` (see |luaref-string.format|).
|
use `string.format` (see |string.format()|).
|
||||||
|
|
||||||
*__tostring*
|
*__tostring*
|
||||||
If the metatable of {e} has a `"__tostring"` field, `tostring` calls
|
If the metatable of {e} has a `"__tostring"` field, `tostring` calls
|
||||||
@@ -3836,7 +3771,7 @@ _VERSION *luaref-_VERSION()*
|
|||||||
`"Lua 5.1"` .
|
`"Lua 5.1"` .
|
||||||
|
|
||||||
xpcall({f}, {err}) *luaref-xpcall()*
|
xpcall({f}, {err}) *luaref-xpcall()*
|
||||||
This function is similar to `pcall` (see |luaref-pcall|), except that
|
This function is similar to `pcall` (see |luaref-pcall()|), except that
|
||||||
you can set a new error handler.
|
you can set a new error handler.
|
||||||
|
|
||||||
`xpcall` calls function {f} in protected mode, using {err} as the
|
`xpcall` calls function {f} in protected mode, using {err} as the
|
||||||
@@ -3901,7 +3836,7 @@ coroutine.yield({...}) *coroutine.yield()*
|
|||||||
|
|
||||||
The package library provides basic facilities for loading and building modules
|
The package library provides basic facilities for loading and building modules
|
||||||
in Lua. It exports two of its functions directly in the global environment:
|
in Lua. It exports two of its functions directly in the global environment:
|
||||||
`require` and `module` (see |luaref-require| and |luaref-module|). Everything else is
|
`require` and `module` (see |luaref-require()| and |luaref-module()|). Everything else is
|
||||||
exported in a table `package`.
|
exported in a table `package`.
|
||||||
|
|
||||||
module({name} [, {...}]) *luaref-module()*
|
module({name} [, {...}]) *luaref-module()*
|
||||||
@@ -3914,7 +3849,7 @@ module({name} [, {...}]) *luaref-module()*
|
|||||||
`t._PACKAGE` with the package name (the full module name minus last
|
`t._PACKAGE` with the package name (the full module name minus last
|
||||||
component; see below). Finally, `module` sets `t` as the new
|
component; see below). Finally, `module` sets `t` as the new
|
||||||
environment of the current function and the new value of
|
environment of the current function and the new value of
|
||||||
`package.loaded[name]`, so that `require` (see |luaref-require|)
|
`package.loaded[name]`, so that `require` (see |luaref-require()|)
|
||||||
returns `t`.
|
returns `t`.
|
||||||
|
|
||||||
If {name} is a compound name (that is, one with components separated
|
If {name} is a compound name (that is, one with components separated
|
||||||
@@ -3968,7 +3903,7 @@ require({modname}) *luaref-require()*
|
|||||||
If there is any error loading or running the module, or if it cannot
|
If there is any error loading or running the module, or if it cannot
|
||||||
find any loader for the module, then `require` signals an error.
|
find any loader for the module, then `require` signals an error.
|
||||||
|
|
||||||
package.cpath *package.cpath()*
|
package.cpath *package.cpath*
|
||||||
The path used by `require` to search for a C loader.
|
The path used by `require` to search for a C loader.
|
||||||
|
|
||||||
Lua initializes the C path `package.cpath` in the same way it
|
Lua initializes the C path `package.cpath` in the same way it
|
||||||
@@ -3985,7 +3920,7 @@ package.loadlib({libname}, {funcname}) *package.loadlib()*
|
|||||||
Dynamically links the host program with the C library {libname}.
|
Dynamically links the host program with the C library {libname}.
|
||||||
Inside this library, looks for a function {funcname} and returns this
|
Inside this library, looks for a function {funcname} and returns this
|
||||||
function as a C function. (So, {funcname} must follow the protocol
|
function as a C function. (So, {funcname} must follow the protocol
|
||||||
(see |luaref-lua_CFunction|)).
|
(see |lua_CFunction()|)).
|
||||||
|
|
||||||
This is a low-level function. It completely bypasses the package and
|
This is a low-level function. It completely bypasses the package and
|
||||||
module system. Unlike `require`, it does not perform any path
|
module system. Unlike `require`, it does not perform any path
|
||||||
@@ -3998,7 +3933,7 @@ package.loadlib({libname}, {funcname}) *package.loadlib()*
|
|||||||
available on some platforms (Windows, Linux, Mac OS X, Solaris, BSD,
|
available on some platforms (Windows, Linux, Mac OS X, Solaris, BSD,
|
||||||
plus other Unix systems that support the `dlfcn` standard).
|
plus other Unix systems that support the `dlfcn` standard).
|
||||||
|
|
||||||
package.path *package.path()*
|
package.path *package.path*
|
||||||
The path used by `require` to search for a Lua loader.
|
The path used by `require` to search for a Lua loader.
|
||||||
|
|
||||||
At start-up, Lua initializes this variable with the value of the
|
At start-up, Lua initializes this variable with the value of the
|
||||||
@@ -4019,7 +3954,7 @@ package.path *package.path()*
|
|||||||
order.
|
order.
|
||||||
|
|
||||||
package.preload *package.preload()*
|
package.preload *package.preload()*
|
||||||
A table to store loaders for specific modules (see |luaref-require|).
|
A table to store loaders for specific modules (see |luaref-require()|).
|
||||||
|
|
||||||
package.seeall({module}) *package.seeall()*
|
package.seeall({module}) *package.seeall()*
|
||||||
Sets a metatable for {module} with its `__index` field referring to
|
Sets a metatable for {module} with its `__index` field referring to
|
||||||
@@ -4059,7 +3994,7 @@ string.char({...}) *string.char()*
|
|||||||
|
|
||||||
string.dump({function}) *string.dump()*
|
string.dump({function}) *string.dump()*
|
||||||
Returns a string containing a binary representation of the given
|
Returns a string containing a binary representation of the given
|
||||||
function, so that a later |luaref-loadstring| on this string returns a
|
function, so that a later |luaref-loadstring()| on this string returns a
|
||||||
copy of the function. {function} must be a Lua function without
|
copy of the function. {function} must be a Lua function without
|
||||||
upvalues.
|
upvalues.
|
||||||
|
|
||||||
@@ -4341,7 +4276,7 @@ table.foreach({table}, {f}) *table.foreach()*
|
|||||||
returns a non-`nil` value, then the loop is broken, and this value is
|
returns a non-`nil` value, then the loop is broken, and this value is
|
||||||
returned as the final value of `table.foreach`.
|
returned as the final value of `table.foreach`.
|
||||||
|
|
||||||
See |luaref-next| for extra information about table traversals.
|
See |luaref-next()| for extra information about table traversals.
|
||||||
|
|
||||||
table.foreachi({table}, {f}) *table.foreachi()*
|
table.foreachi({table}, {f}) *table.foreachi()*
|
||||||
Executes the given {f} over the numerical indices of {table}. For each
|
Executes the given {f} over the numerical indices of {table}. For each
|
||||||
@@ -4658,7 +4593,7 @@ file:setvbuf({mode} [, {size}]) *luaref-file:setvbuf()*
|
|||||||
immediately.
|
immediately.
|
||||||
`"full"` full buffering; output operation is performed only when
|
`"full"` full buffering; output operation is performed only when
|
||||||
the buffer is full (or when you explicitly `flush` the file
|
the buffer is full (or when you explicitly `flush` the file
|
||||||
(see |luaref-io.flush|).
|
(see |io.flush()|).
|
||||||
`"line"` line buffering; output is buffered until a newline is
|
`"line"` line buffering; output is buffered until a newline is
|
||||||
output or there is any input from some special files (such as
|
output or there is any input from some special files (such as
|
||||||
a terminal device).
|
a terminal device).
|
||||||
@@ -4669,7 +4604,7 @@ file:setvbuf({mode} [, {size}]) *luaref-file:setvbuf()*
|
|||||||
file:write({...}) *luaref-file:write()*
|
file:write({...}) *luaref-file:write()*
|
||||||
Writes the value of each of its arguments to `file`. The arguments
|
Writes the value of each of its arguments to `file`. The arguments
|
||||||
must be strings or numbers. To write other values, use `tostring`
|
must be strings or numbers. To write other values, use `tostring`
|
||||||
|luaref-tostring| or `string.format` |luaref-string.format| before
|
|luaref-tostring()| or `string.format` |string.format()| before
|
||||||
`write`.
|
`write`.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
@@ -4686,7 +4621,7 @@ os.date([{format} [, {time}]]) *os.date()*
|
|||||||
according to the given string {format}.
|
according to the given string {format}.
|
||||||
|
|
||||||
If the {time} argument is present, this is the time to be formatted
|
If the {time} argument is present, this is the time to be formatted
|
||||||
(see the `os.time` function |luaref-os.time| for a description of this
|
(see the `os.time` function |os.time()| for a description of this
|
||||||
value). Otherwise, `date` formats the current time.
|
value). Otherwise, `date` formats the current time.
|
||||||
|
|
||||||
If {format} starts with `!`, then the date is formatted in
|
If {format} starts with `!`, then the date is formatted in
|
||||||
@@ -4744,7 +4679,7 @@ os.time([{table}]) *os.time()*
|
|||||||
representing the date and time specified by the given table. This
|
representing the date and time specified by the given table. This
|
||||||
table must have fields `year`, `month`, and `day`, and may have fields
|
table must have fields `year`, `month`, and `day`, and may have fields
|
||||||
`hour`, `min`, `sec`, and `isdst` (for a description of these fields,
|
`hour`, `min`, `sec`, and `isdst` (for a description of these fields,
|
||||||
see the `os.date` function |luaref-os.date|).
|
see the `os.date` function |os.date()|).
|
||||||
|
|
||||||
The returned value is a number, whose meaning depends on your system.
|
The returned value is a number, whose meaning depends on your system.
|
||||||
In POSIX, Windows, and some other systems, this number counts the
|
In POSIX, Windows, and some other systems, this number counts the
|
||||||
@@ -4802,7 +4737,7 @@ debug.getinfo([{thread},] {function} [, {what}]) *debug.getinfo()*
|
|||||||
functions, then `getinfo` returns `nil`.
|
functions, then `getinfo` returns `nil`.
|
||||||
|
|
||||||
The returned table may contain all the fields returned by
|
The returned table may contain all the fields returned by
|
||||||
`lua_getinfo` (see |luaref-lua_getinfo|), with the string {what}
|
`lua_getinfo` (see |lua_getinfo()|), with the string {what}
|
||||||
describing which fields to fill in. The default for {what} is to get
|
describing which fields to fill in. The default for {what} is to get
|
||||||
all information available, except the table of valid lines. If
|
all information available, except the table of valid lines. If
|
||||||
present, the option `f` adds a field named `func` with the function
|
present, the option `f` adds a field named `func` with the function
|
||||||
@@ -4821,7 +4756,7 @@ debug.getlocal([{thread},] {level}, {local}) *debug.getlocal()*
|
|||||||
last active local variable.) The function returns `nil` if there is no
|
last active local variable.) The function returns `nil` if there is no
|
||||||
local variable with the given index, and raises an error when called
|
local variable with the given index, and raises an error when called
|
||||||
with a {level} out of range. (You can call `debug.getinfo`
|
with a {level} out of range. (You can call `debug.getinfo`
|
||||||
|luaref-debug.getinfo| to check whether the level is valid.)
|
|debug.getinfo()| to check whether the level is valid.)
|
||||||
|
|
||||||
Variable names starting with `(` (open parentheses) represent
|
Variable names starting with `(` (open parentheses) represent
|
||||||
internal variables (loop control variables, temporaries, and C
|
internal variables (loop control variables, temporaries, and C
|
||||||
@@ -4953,7 +4888,7 @@ C LUAREF DOC *luarefvim* *luarefvimdoc* *luaref-help* *luaref-d
|
|||||||
This is a Vim help file containing a reference for Lua 5.1, and it is -- with
|
This is a Vim help file containing a reference for Lua 5.1, and it is -- with
|
||||||
a few exceptions and adaptations -- a copy of the Lua 5.1 Reference Manual
|
a few exceptions and adaptations -- a copy of the Lua 5.1 Reference Manual
|
||||||
(see |luaref-bibliography|). For usage information, refer to
|
(see |luaref-bibliography|). For usage information, refer to
|
||||||
|luaref-docUsage|. For copyright information, see |luaref-copyright|.
|
|luaref-doc|. For copyright information, see |luaref-copyright|.
|
||||||
|
|
||||||
The main ideas and concepts on how to implement this reference were taken from
|
The main ideas and concepts on how to implement this reference were taken from
|
||||||
Christian Habermann's CRefVim project
|
Christian Habermann's CRefVim project
|
||||||
|
@@ -1673,7 +1673,7 @@ backslash followed by a character other than white space or a backslash
|
|||||||
remains unmodified. Overview:
|
remains unmodified. Overview:
|
||||||
|
|
||||||
command <f-args> ~
|
command <f-args> ~
|
||||||
XX ab 'ab'
|
XX ab "ab"
|
||||||
XX a\b 'a\b'
|
XX a\b 'a\b'
|
||||||
XX a\ b 'a b'
|
XX a\ b 'a b'
|
||||||
XX a\ b 'a ', 'b'
|
XX a\ b 'a ', 'b'
|
||||||
|
@@ -86,9 +86,8 @@ You can also set 'guifont' alone, the Nvim GUI will try to find a matching
|
|||||||
INPUT
|
INPUT
|
||||||
|
|
||||||
There are several ways to enter multibyte characters:
|
There are several ways to enter multibyte characters:
|
||||||
- For X11 XIM can be used. See |XIM|.
|
- Your system IME can be used.
|
||||||
- For MS-Windows IME can be used. See |IME|.
|
- Keymaps can be used. See |mbyte-keymap|.
|
||||||
- For all systems keymaps can be used. See |mbyte-keymap|.
|
|
||||||
|
|
||||||
The options 'iminsert', 'imsearch' and 'imcmdline' can be used to choose
|
The options 'iminsert', 'imsearch' and 'imcmdline' can be used to choose
|
||||||
the different input methods or disable them temporarily.
|
the different input methods or disable them temporarily.
|
||||||
|
@@ -5704,7 +5704,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
"yes:[1-9]" always, with fixed space for signs up to the given
|
"yes:[1-9]" always, with fixed space for signs up to the given
|
||||||
number (maximum 9), e.g. "yes:3"
|
number (maximum 9), e.g. "yes:3"
|
||||||
"number" display signs in the 'number' column. If the number
|
"number" display signs in the 'number' column. If the number
|
||||||
column is not present, then behaves like 'auto'.
|
column is not present, then behaves like "auto".
|
||||||
|
|
||||||
Note regarding 'orphaned signs': with signcolumn numbers higher than
|
Note regarding 'orphaned signs': with signcolumn numbers higher than
|
||||||
1, deleting lines will also remove the associated signs automatically,
|
1, deleting lines will also remove the associated signs automatically,
|
||||||
@@ -6481,7 +6481,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
'termguicolors' 'tgc' boolean (default off)
|
'termguicolors' 'tgc' boolean (default off)
|
||||||
global
|
global
|
||||||
Enables 24-bit RGB color in the |TUI|. Uses "gui" |:highlight|
|
Enables 24-bit RGB color in the |TUI|. Uses "gui" |:highlight|
|
||||||
attributes instead of "cterm" attributes. |highlight-guifg|
|
attributes instead of "cterm" attributes. |guifg|
|
||||||
Requires an ISO-8613-3 compatible terminal.
|
Requires an ISO-8613-3 compatible terminal.
|
||||||
|
|
||||||
*'termpastefilter'* *'tpf'*
|
*'termpastefilter'* *'tpf'*
|
||||||
@@ -7136,7 +7136,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
the window.
|
the window.
|
||||||
|
|
||||||
Note: highlight namespaces take precedence over 'winhighlight'.
|
Note: highlight namespaces take precedence over 'winhighlight'.
|
||||||
See |nvim_win_set_hl_ns| and |nvim_set_hl|.
|
See |nvim_win_set_hl_ns()| and |nvim_set_hl()|.
|
||||||
|
|
||||||
Highlights of vertical separators are determined by the window to the
|
Highlights of vertical separators are determined by the window to the
|
||||||
left of the separator. The 'tabline' highlight of a tabpage is
|
left of the separator. The 'tabline' highlight of a tabpage is
|
||||||
|
@@ -2353,7 +2353,7 @@ MARKED FILES: DIFF *netrw-md* {{{2
|
|||||||
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
(See |netrw-mf| and |netrw-mr| for how to mark files)
|
||||||
(uses the global marked file list)
|
(uses the global marked file list)
|
||||||
|
|
||||||
Use |vimdiff| to visualize difference between selected files (two or
|
Use vimdiff to visualize difference between selected files (two or
|
||||||
three may be selected for this). Uses the global marked file list.
|
three may be selected for this). Uses the global marked file list.
|
||||||
|
|
||||||
MARKED FILES: EDITING *netrw-me* {{{2
|
MARKED FILES: EDITING *netrw-me* {{{2
|
||||||
@@ -3469,7 +3469,7 @@ Example: Clear netrw's marked file list via a mapping on gu >
|
|||||||
*netrw-p4*
|
*netrw-p4*
|
||||||
P4. I would like long listings to be the default. {{{2
|
P4. I would like long listings to be the default. {{{2
|
||||||
|
|
||||||
Put the following statement into your |.vimrc|: >
|
Put the following statement into your |vimrc|: >
|
||||||
|
|
||||||
let g:netrw_liststyle= 1
|
let g:netrw_liststyle= 1
|
||||||
<
|
<
|
||||||
@@ -3482,7 +3482,7 @@ Example: Clear netrw's marked file list via a mapping on gu >
|
|||||||
Does your system's strftime() accept the "%c" to yield dates
|
Does your system's strftime() accept the "%c" to yield dates
|
||||||
such as "Sun Apr 27 11:49:23 1997"? If not, do a
|
such as "Sun Apr 27 11:49:23 1997"? If not, do a
|
||||||
"man strftime" and find out what option should be used. Then
|
"man strftime" and find out what option should be used. Then
|
||||||
put it into your |.vimrc|: >
|
put it into your |vimrc|: >
|
||||||
|
|
||||||
let g:netrw_timefmt= "%X" (where X is the option)
|
let g:netrw_timefmt= "%X" (where X is the option)
|
||||||
<
|
<
|
||||||
@@ -3490,7 +3490,7 @@ Example: Clear netrw's marked file list via a mapping on gu >
|
|||||||
P6. I want my current directory to track my browsing. {{{2
|
P6. I want my current directory to track my browsing. {{{2
|
||||||
How do I do that?
|
How do I do that?
|
||||||
|
|
||||||
Put the following line in your |.vimrc|:
|
Put the following line in your |vimrc|:
|
||||||
>
|
>
|
||||||
let g:netrw_keepdir= 0
|
let g:netrw_keepdir= 0
|
||||||
<
|
<
|
||||||
@@ -3839,7 +3839,7 @@ netrw:
|
|||||||
or
|
or
|
||||||
http://vim.sourceforge.net/scripts/script.php?script_id=120
|
http://vim.sourceforge.net/scripts/script.php?script_id=120
|
||||||
|
|
||||||
Decho.vim is provided as a "vimball"; see |vimball-intro|. You
|
Decho.vim is provided as a "vimball". You
|
||||||
should edit the Decho.vba.gz file and source it in: >
|
should edit the Decho.vba.gz file and source it in: >
|
||||||
|
|
||||||
vim Decho.vba.gz
|
vim Decho.vba.gz
|
||||||
@@ -3917,7 +3917,7 @@ netrw:
|
|||||||
* Installed |g:netrw_clipboard| setting
|
* Installed |g:netrw_clipboard| setting
|
||||||
* Installed option bypass for |'guioptions'|
|
* Installed option bypass for |'guioptions'|
|
||||||
a/A settings
|
a/A settings
|
||||||
* Changed popup_beval() to |popup_atcursor()|
|
* Changed popup_beval() to popup_atcursor()
|
||||||
in netrw#ErrorMsg (lacygoill). Apparently
|
in netrw#ErrorMsg (lacygoill). Apparently
|
||||||
popup_beval doesn't reliably close the
|
popup_beval doesn't reliably close the
|
||||||
popup when the mouse is moved.
|
popup when the mouse is moved.
|
||||||
@@ -3943,7 +3943,7 @@ netrw:
|
|||||||
did not restore options correctly that
|
did not restore options correctly that
|
||||||
had a single quote in the option string.
|
had a single quote in the option string.
|
||||||
Apr 13, 2020 * implemented error handling via popup
|
Apr 13, 2020 * implemented error handling via popup
|
||||||
windows (see |popup_beval()|)
|
windows (see popup_beval())
|
||||||
Apr 30, 2020 * (reported by Manatsu Takahashi) while
|
Apr 30, 2020 * (reported by Manatsu Takahashi) while
|
||||||
using Lexplore, a modified file could
|
using Lexplore, a modified file could
|
||||||
be overwritten. Sol'n: will not overwrite,
|
be overwritten. Sol'n: will not overwrite,
|
||||||
|
@@ -659,7 +659,7 @@ It is possible to achieve a poor man's version of duplex printing using the PS
|
|||||||
utility psselect. This utility has options -e and -o for printing just the
|
utility psselect. This utility has options -e and -o for printing just the
|
||||||
even or odd pages of a PS file respectively.
|
even or odd pages of a PS file respectively.
|
||||||
|
|
||||||
First generate a PS file with the 'hardcopy' command, then generate new
|
First generate a PS file with the ":hardcopy" command, then generate new
|
||||||
files with all the odd and even numbered pages with: >
|
files with all the odd and even numbered pages with: >
|
||||||
|
|
||||||
psselect -o test.ps odd.ps
|
psselect -o test.ps odd.ps
|
||||||
|
@@ -240,7 +240,7 @@ a list of lines and `regtype` is a register type conforming to |setreg()|.
|
|||||||
Paste *provider-paste* *paste*
|
Paste *provider-paste* *paste*
|
||||||
|
|
||||||
"Paste" is a separate concept from |clipboard|: paste means "dump a bunch of
|
"Paste" is a separate concept from |clipboard|: paste means "dump a bunch of
|
||||||
text to the editor", whereas clipboard provides features like |quote-+| to get
|
text to the editor", whereas clipboard provides features like |quote+| to get
|
||||||
and set the OS clipboard directly. For example, middle-click or CTRL-SHIFT-v
|
and set the OS clipboard directly. For example, middle-click or CTRL-SHIFT-v
|
||||||
(macOS: CMD-v) in your terminal is "paste", not "clipboard": the terminal
|
(macOS: CMD-v) in your terminal is "paste", not "clipboard": the terminal
|
||||||
application (Nvim) just gets a stream of text, it does not interact with the
|
application (Nvim) just gets a stream of text, it does not interact with the
|
||||||
|
@@ -466,7 +466,7 @@ You can parse a list of lines using 'errorformat' without creating or
|
|||||||
modifying a quickfix list using the |getqflist()| function. Examples: >
|
modifying a quickfix list using the |getqflist()| function. Examples: >
|
||||||
echo getqflist({'lines' : ["F1:10:Line10", "F2:20:Line20"]})
|
echo getqflist({'lines' : ["F1:10:Line10", "F2:20:Line20"]})
|
||||||
echo getqflist({'lines' : systemlist('grep -Hn quickfix *')})
|
echo getqflist({'lines' : systemlist('grep -Hn quickfix *')})
|
||||||
This returns a dictionary where the 'items' key contains the list of quickfix
|
This returns a dictionary where the "items" key contains the list of quickfix
|
||||||
entries parsed from lines. The following shows how to use a custom
|
entries parsed from lines. The following shows how to use a custom
|
||||||
'errorformat' to parse the lines without modifying the 'errorformat' option: >
|
'errorformat' to parse the lines without modifying the 'errorformat' option: >
|
||||||
echo getqflist({'efm' : '%f#%l#%m', 'lines' : ['F1#10#Line']})
|
echo getqflist({'efm' : '%f#%l#%m', 'lines' : ['F1#10#Line']})
|
||||||
@@ -585,7 +585,7 @@ can go back to the unfiltered list using the |:colder|/|:lolder| command.
|
|||||||
quickfix command or function, the |b:changedtick|
|
quickfix command or function, the |b:changedtick|
|
||||||
variable is incremented. You can get the number of
|
variable is incremented. You can get the number of
|
||||||
this buffer using the getqflist() and getloclist()
|
this buffer using the getqflist() and getloclist()
|
||||||
functions by passing the 'qfbufnr' item. For a
|
functions by passing the "qfbufnr" item. For a
|
||||||
location list, this buffer is wiped out when the
|
location list, this buffer is wiped out when the
|
||||||
location list is removed.
|
location list is removed.
|
||||||
|
|
||||||
@@ -1965,7 +1965,7 @@ The function should return a single line of text to display in the quickfix
|
|||||||
window for each entry from start_idx to end_idx. The function can obtain
|
window for each entry from start_idx to end_idx. The function can obtain
|
||||||
information about the entries using the |getqflist()| function and specifying
|
information about the entries using the |getqflist()| function and specifying
|
||||||
the quickfix list identifier "id". For a location list, getloclist() function
|
the quickfix list identifier "id". For a location list, getloclist() function
|
||||||
can be used with the 'winid' argument. If an empty list is returned, then the
|
can be used with the "winid" argument. If an empty list is returned, then the
|
||||||
default format is used to display all the entries. If an item in the returned
|
default format is used to display all the entries. If an item in the returned
|
||||||
list is an empty string, then the default format is used to display the
|
list is an empty string, then the default format is used to display the
|
||||||
corresponding entry.
|
corresponding entry.
|
||||||
|
@@ -615,10 +615,6 @@ Short explanation of each option: *option-list*
|
|||||||
'backupdir' 'bdir' list of directories for the backup file
|
'backupdir' 'bdir' list of directories for the backup file
|
||||||
'backupext' 'bex' extension used for the backup file
|
'backupext' 'bex' extension used for the backup file
|
||||||
'backupskip' 'bsk' no backup for files that match these patterns
|
'backupskip' 'bsk' no backup for files that match these patterns
|
||||||
'balloondelay' 'bdlay' delay in mS before a balloon may pop up
|
|
||||||
'ballooneval' 'beval' switch on balloon evaluation in the GUI
|
|
||||||
'balloonevalterm' 'bevalterm' switch on balloon evaluation in the terminal
|
|
||||||
'balloonexpr' 'bexpr' expression to show in balloon
|
|
||||||
'belloff' 'bo' do not ring the bell for these reasons
|
'belloff' 'bo' do not ring the bell for these reasons
|
||||||
'binary' 'bin' read/write/edit file in binary mode
|
'binary' 'bin' read/write/edit file in binary mode
|
||||||
'bomb' prepend a Byte Order Mark to the file
|
'bomb' prepend a Byte Order Mark to the file
|
||||||
@@ -817,8 +813,6 @@ Short explanation of each option: *option-list*
|
|||||||
'printoptions' 'popt' controls the format of :hardcopy output
|
'printoptions' 'popt' controls the format of :hardcopy output
|
||||||
'pumheight' 'ph' maximum height of the popup menu
|
'pumheight' 'ph' maximum height of the popup menu
|
||||||
'pumwidth' 'pw' minimum width of the popup menu
|
'pumwidth' 'pw' minimum width of the popup menu
|
||||||
'pythondll' name of the Python 2 dynamic library
|
|
||||||
'pythonthreedll' name of the Python 3 dynamic library
|
|
||||||
'pyxversion' 'pyx' Python version used for pyx* commands
|
'pyxversion' 'pyx' Python version used for pyx* commands
|
||||||
'quoteescape' 'qe' escape characters used in a string
|
'quoteescape' 'qe' escape characters used in a string
|
||||||
'readonly' 'ro' disallow writing the buffer
|
'readonly' 'ro' disallow writing the buffer
|
||||||
@@ -829,7 +823,6 @@ Short explanation of each option: *option-list*
|
|||||||
'revins' 'ri' inserting characters will work backwards
|
'revins' 'ri' inserting characters will work backwards
|
||||||
'rightleft' 'rl' window is right-to-left oriented
|
'rightleft' 'rl' window is right-to-left oriented
|
||||||
'rightleftcmd' 'rlc' commands for which editing works right-to-left
|
'rightleftcmd' 'rlc' commands for which editing works right-to-left
|
||||||
'rubydll' name of the Ruby dynamic library
|
|
||||||
'ruler' 'ru' show cursor line and column in the status line
|
'ruler' 'ru' show cursor line and column in the status line
|
||||||
'rulerformat' 'ruf' custom format for the ruler
|
'rulerformat' 'ruf' custom format for the ruler
|
||||||
'runtimepath' 'rtp' list of directories used for runtime files
|
'runtimepath' 'rtp' list of directories used for runtime files
|
||||||
|
@@ -591,7 +591,7 @@ This could be done if some conditions are met. For example, depending on
|
|||||||
whether Vim supports a feature or a dependency is missing.
|
whether Vim supports a feature or a dependency is missing.
|
||||||
|
|
||||||
You can also load an optional plugin at startup, by putting this command in
|
You can also load an optional plugin at startup, by putting this command in
|
||||||
your |.vimrc|: >
|
your |config|: >
|
||||||
:packadd! foodebug
|
:packadd! foodebug
|
||||||
The extra "!" is so that the plugin isn't loaded if Vim was started with
|
The extra "!" is so that the plugin isn't loaded if Vim was started with
|
||||||
|--noplugin|.
|
|--noplugin|.
|
||||||
|
@@ -82,12 +82,10 @@ argument.
|
|||||||
--help *-h* *--help* *-?*
|
--help *-h* *--help* *-?*
|
||||||
-?
|
-?
|
||||||
-h Give usage (help) message and exit.
|
-h Give usage (help) message and exit.
|
||||||
See |info-message| about capturing the text.
|
|
||||||
|
|
||||||
--version *-v* *--version*
|
--version *-v* *--version*
|
||||||
-v Print version information and exit. Same output as for
|
-v Print version information and exit. Same output as for
|
||||||
|:version| command.
|
|:version| command.
|
||||||
See |info-message| about capturing the text.
|
|
||||||
|
|
||||||
*--clean*
|
*--clean*
|
||||||
--clean Mimics a fresh install of Nvim:
|
--clean Mimics a fresh install of Nvim:
|
||||||
|
@@ -3118,7 +3118,7 @@ The default is to use the twice sh_minlines. Set it to a smaller number to
|
|||||||
speed up displaying. The disadvantage is that highlight errors may appear.
|
speed up displaying. The disadvantage is that highlight errors may appear.
|
||||||
|
|
||||||
syntax/sh.vim tries to flag certain problems as errors; usually things like
|
syntax/sh.vim tries to flag certain problems as errors; usually things like
|
||||||
extra ']'s, 'done's, 'fi's, etc. If you find the error handling problematic
|
extra "]"s, "done"s, "fi"s, etc. If you find the error handling problematic
|
||||||
for your purposes, you may suppress such error highlighting by putting
|
for your purposes, you may suppress such error highlighting by putting
|
||||||
the following line in your .vimrc: >
|
the following line in your .vimrc: >
|
||||||
|
|
||||||
@@ -4935,7 +4935,7 @@ cterm={attr-list} *attr-list* *highlight-cterm* *E418*
|
|||||||
have the same effect.
|
have the same effect.
|
||||||
"undercurl", "underdouble", "underdotted", and "underdashed" fall back
|
"undercurl", "underdouble", "underdotted", and "underdashed" fall back
|
||||||
to "underline" in a terminal that does not support them. The color is
|
to "underline" in a terminal that does not support them. The color is
|
||||||
set using |highlight-guisp|.
|
set using |guisp|.
|
||||||
|
|
||||||
start={term-list} *highlight-start* *E422*
|
start={term-list} *highlight-start* *E422*
|
||||||
stop={term-list} *term-list* *highlight-stop*
|
stop={term-list} *term-list* *highlight-stop*
|
||||||
@@ -4956,8 +4956,8 @@ stop={term-list} *term-list* *highlight-stop*
|
|||||||
like "<Esc>" and "<Space>". Example:
|
like "<Esc>" and "<Space>". Example:
|
||||||
start=<Esc>[27h;<Esc>[<Space>r;
|
start=<Esc>[27h;<Esc>[<Space>r;
|
||||||
|
|
||||||
ctermfg={color-nr} *highlight-ctermfg* *E421*
|
ctermfg={color-nr} *ctermfg* *E421*
|
||||||
ctermbg={color-nr} *highlight-ctermbg*
|
ctermbg={color-nr} *ctermbg*
|
||||||
The {color-nr} argument is a color number. Its range is zero to
|
The {color-nr} argument is a color number. Its range is zero to
|
||||||
(not including) the number of |tui-colors| available.
|
(not including) the number of |tui-colors| available.
|
||||||
The actual color with this number depends on the type of terminal
|
The actual color with this number depends on the type of terminal
|
||||||
@@ -5064,9 +5064,9 @@ font={font-name} *highlight-font*
|
|||||||
Example: >
|
Example: >
|
||||||
:hi comment font='Monospace 10'
|
:hi comment font='Monospace 10'
|
||||||
|
|
||||||
guifg={color-name} *highlight-guifg*
|
guifg={color-name} *guifg*
|
||||||
guibg={color-name} *highlight-guibg*
|
guibg={color-name} *guibg*
|
||||||
guisp={color-name} *highlight-guisp*
|
guisp={color-name} *guisp*
|
||||||
These give the foreground (guifg), background (guibg) and special
|
These give the foreground (guifg), background (guibg) and special
|
||||||
(guisp) color to use in the GUI. "guisp" is used for various
|
(guisp) color to use in the GUI. "guisp" is used for various
|
||||||
underlines.
|
underlines.
|
||||||
@@ -5123,7 +5123,7 @@ Cursor Character under the cursor.
|
|||||||
lCursor Character under the cursor when |language-mapping|
|
lCursor Character under the cursor when |language-mapping|
|
||||||
is used (see 'guicursor').
|
is used (see 'guicursor').
|
||||||
*hl-CursorIM*
|
*hl-CursorIM*
|
||||||
CursorIM Like Cursor, but used when in IME mode. |CursorIM|
|
CursorIM Like Cursor, but used when in IME mode. *CursorIM*
|
||||||
*hl-CursorColumn*
|
*hl-CursorColumn*
|
||||||
CursorColumn Screen-column at the cursor, when 'cursorcolumn' is set.
|
CursorColumn Screen-column at the cursor, when 'cursorcolumn' is set.
|
||||||
*hl-CursorLine*
|
*hl-CursorLine*
|
||||||
|
@@ -50,13 +50,13 @@ Whenever you need to access the current syntax tree, parse the buffer: >
|
|||||||
|
|
||||||
tstree = tsparser:parse()
|
tstree = tsparser:parse()
|
||||||
<
|
<
|
||||||
This will return a table of immutable |lua-treesitter-tree|s that represent the
|
This will return a table of immutable |treesitter-tree|s that represent the
|
||||||
current state of the buffer. When the plugin wants to access the state after a
|
current state of the buffer. When the plugin wants to access the state after a
|
||||||
(possible) edit it should call `parse()` again. If the buffer wasn't edited,
|
(possible) edit it should call `parse()` again. If the buffer wasn't edited,
|
||||||
the same tree will be returned again without extra work. If the buffer was
|
the same tree will be returned again without extra work. If the buffer was
|
||||||
parsed before, incremental parsing will be done of the changed parts.
|
parsed before, incremental parsing will be done of the changed parts.
|
||||||
|
|
||||||
Note: To use the parser directly inside a |nvim_buf_attach/)| Lua callback, you
|
Note: To use the parser directly inside a |nvim_buf_attach()| Lua callback, you
|
||||||
must call |get_parser()| before you register your callback. But preferably
|
must call |get_parser()| before you register your callback. But preferably
|
||||||
parsing shouldn't be done directly in the change callback anyway as they will
|
parsing shouldn't be done directly in the change callback anyway as they will
|
||||||
be very frequent. Rather a plugin that does any kind of analysis on a tree
|
be very frequent. Rather a plugin that does any kind of analysis on a tree
|
||||||
@@ -233,7 +233,7 @@ The following predicates are built in:
|
|||||||
node's text.
|
node's text.
|
||||||
|
|
||||||
`lua-match?` *treesitter-predicate-lua-match?*
|
`lua-match?` *treesitter-predicate-lua-match?*
|
||||||
Match a |lua-pattern| against the text corresponding to a node,
|
Match |lua-patterns| against the text corresponding to a node,
|
||||||
similar to `match?`
|
similar to `match?`
|
||||||
|
|
||||||
`contains?` *treesitter-predicate-contains?*
|
`contains?` *treesitter-predicate-contains?*
|
||||||
@@ -394,7 +394,7 @@ still highlighted the same as other operators: >
|
|||||||
|
|
||||||
"!=" @operator (#set! conceal "≠")
|
"!=" @operator (#set! conceal "≠")
|
||||||
<
|
<
|
||||||
Conceals specified in this way respect |conceallevel|.
|
Conceals specified in this way respect 'conceallevel'.
|
||||||
|
|
||||||
*treesitter-highlight-priority*
|
*treesitter-highlight-priority*
|
||||||
Treesitter uses |nvim_buf_set_extmark()| to set highlights with a default
|
Treesitter uses |nvim_buf_set_extmark()| to set highlights with a default
|
||||||
@@ -650,7 +650,7 @@ get_query({lang}, {query_name}) *get_query()*
|
|||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{lang} (string) Language to use for the query
|
{lang} (string) Language to use for the query
|
||||||
{query_name} (string) Name of the query (e.g. 'highlights')
|
{query_name} (string) Name of the query (e.g. "highlights")
|
||||||
|
|
||||||
Return: ~
|
Return: ~
|
||||||
Query Parsed query
|
Query Parsed query
|
||||||
@@ -661,7 +661,7 @@ get_query_files({lang}, {query_name}, {is_included})
|
|||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{lang} (string) Language to get query for
|
{lang} (string) Language to get query for
|
||||||
{query_name} (string) Name of the query to load (e.g., 'highlights')
|
{query_name} (string) Name of the query to load (e.g., "highlights")
|
||||||
{is_included} (boolean|nil) Internal parameter, most of the time left
|
{is_included} (boolean|nil) Internal parameter, most of the time left
|
||||||
as `nil`
|
as `nil`
|
||||||
|
|
||||||
@@ -742,7 +742,7 @@ Query:iter_matches({self}, {node}, {source}, {start}, {stop})
|
|||||||
Iterates the matches of self on a given range.
|
Iterates the matches of self on a given range.
|
||||||
|
|
||||||
Iterate over all matches within a {node}. The arguments are the same as
|
Iterate over all matches within a {node}. The arguments are the same as
|
||||||
for |query:iter_captures()| but the iterated values are different: an
|
for |Query:iter_captures()| but the iterated values are different: an
|
||||||
(1-based) index of the pattern in the query, a table mapping capture
|
(1-based) index of the pattern in the query, a table mapping capture
|
||||||
indices to nodes, and metadata from any directives processing the match.
|
indices to nodes, and metadata from any directives processing the match.
|
||||||
If the query has more than one pattern, the capture table might be sparse
|
If the query has more than one pattern, the capture table might be sparse
|
||||||
@@ -780,7 +780,7 @@ set_query({lang}, {query_name}, {text}) *set_query()*
|
|||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
{lang} (string) Language to use for the query
|
{lang} (string) Language to use for the query
|
||||||
{query_name} (string) Name of the query (e.g., 'highlights')
|
{query_name} (string) Name of the query (e.g., "highlights")
|
||||||
{text} (string) Query text (unparsed).
|
{text} (string) Query text (unparsed).
|
||||||
|
|
||||||
|
|
||||||
|
@@ -576,7 +576,7 @@ The multigrid extension gives UIs more control over how windows are displayed:
|
|||||||
per-window. Or reserve space around the border of the window for its own
|
per-window. Or reserve space around the border of the window for its own
|
||||||
elements, such as scrollbars from the UI toolkit.
|
elements, such as scrollbars from the UI toolkit.
|
||||||
- A dedicated grid is used for messages, which may scroll over the window
|
- A dedicated grid is used for messages, which may scroll over the window
|
||||||
area. (Alternatively |ext_messages| can be used).
|
area. (Alternatively |ui-messages| can be used).
|
||||||
|
|
||||||
By default, the grid size is handled by Nvim and set to the outer grid size
|
By default, the grid size is handled by Nvim and set to the outer grid size
|
||||||
(i.e. the size of the window frame in Nvim) whenever the split is created.
|
(i.e. the size of the window frame in Nvim) whenever the split is created.
|
||||||
@@ -618,7 +618,7 @@ tabs.
|
|||||||
flag). The Builtin TUI draws a full line filled with `sep_char` and
|
flag). The Builtin TUI draws a full line filled with `sep_char` and
|
||||||
|hl-MsgSeparator| highlight.
|
|hl-MsgSeparator| highlight.
|
||||||
|
|
||||||
When |ext_messages| is active, no message grid is used, and this event
|
When |ui-messages| is active, no message grid is used, and this event
|
||||||
will not be sent.
|
will not be sent.
|
||||||
|
|
||||||
["win_viewport", grid, win, topline, botline, curline, curcol]
|
["win_viewport", grid, win, topline, botline, curline, curcol]
|
||||||
|
@@ -214,7 +214,7 @@ It is allowed to define another function inside a function body.
|
|||||||
You can provide default values for positional named arguments. This makes
|
You can provide default values for positional named arguments. This makes
|
||||||
them optional for function calls. When a positional argument is not
|
them optional for function calls. When a positional argument is not
|
||||||
specified at a call, the default expression is used to initialize it.
|
specified at a call, the default expression is used to initialize it.
|
||||||
This only works for functions declared with |function|, not for
|
This only works for functions declared with |:function|, not for
|
||||||
lambda expressions |expr-lambda|.
|
lambda expressions |expr-lambda|.
|
||||||
|
|
||||||
Example: >
|
Example: >
|
||||||
@@ -422,8 +422,7 @@ Also note that if you have two script files, and one calls a function in the
|
|||||||
other and vice versa, before the used function is defined, it won't work.
|
other and vice versa, before the used function is defined, it won't work.
|
||||||
Avoid using the autoload functionality at the toplevel.
|
Avoid using the autoload functionality at the toplevel.
|
||||||
|
|
||||||
Hint: If you distribute a bunch of scripts you can pack them together with the
|
Hint: If you distribute a bunch of scripts read |distribute-script|.
|
||||||
|vimball| utility. Also read the user manual |distribute-script|.
|
|
||||||
|
|
||||||
|
|
||||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||||
|
@@ -1710,7 +1710,7 @@ There is a little "catch" with comments for some commands. Examples: >
|
|||||||
:execute cmd " do it
|
:execute cmd " do it
|
||||||
:!ls *.c " list C files
|
:!ls *.c " list C files
|
||||||
|
|
||||||
The abbreviation 'dev' will be expanded to 'development " shorthand'. The
|
The abbreviation "dev" will be expanded to 'development " shorthand'. The
|
||||||
mapping of <F3> will actually be the whole line after the 'o# ....' including
|
mapping of <F3> will actually be the whole line after the 'o# ....' including
|
||||||
the '" insert include'. The "execute" command will give an error. The "!"
|
the '" insert include'. The "execute" command will give an error. The "!"
|
||||||
command will send everything after it to the shell, causing an error for an
|
command will send everything after it to the shell, causing an error for an
|
||||||
|
@@ -300,8 +300,7 @@ can use digraphs. This was already explained in |24.9|.
|
|||||||
keyboard, you will want to use an Input Method (IM). This requires learning
|
keyboard, you will want to use an Input Method (IM). This requires learning
|
||||||
the translation from typed keys to resulting character. When you need an IM
|
the translation from typed keys to resulting character. When you need an IM
|
||||||
you probably already have one on your system. It should work with Vim like
|
you probably already have one on your system. It should work with Vim like
|
||||||
with other programs. For details see |mbyte-XIM| for the X Window system and
|
with other programs.
|
||||||
|mbyte-IME| for MS-Windows.
|
|
||||||
|
|
||||||
|
|
||||||
KEYMAPS
|
KEYMAPS
|
||||||
|
@@ -417,8 +417,8 @@ Normal commands:
|
|||||||
|
|
||||||
Options:
|
Options:
|
||||||
'ttimeout', 'ttimeoutlen' behavior was simplified
|
'ttimeout', 'ttimeoutlen' behavior was simplified
|
||||||
|jumpoptions| "stack" behavior
|
'jumpoptions' "stack" behavior
|
||||||
|jumpoptions| "view" tries to restore the |mark-view| when moving through
|
'jumpoptions' "view" tries to restore the |mark-view| when moving through
|
||||||
the |jumplist|, |changelist|, |alternate-file| or using |mark-motions|.
|
the |jumplist|, |changelist|, |alternate-file| or using |mark-motions|.
|
||||||
'shortmess' the "F" flag does not affect output from autocommands
|
'shortmess' the "F" flag does not affect output from autocommands
|
||||||
|
|
||||||
@@ -498,13 +498,16 @@ Working directory (Vim implemented some of these later than Nvim):
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
5. Missing legacy features *nvim-features-missing*
|
5. Missing legacy features *nvim-features-missing*
|
||||||
|
|
||||||
Some legacy Vim features are not implemented:
|
Some legacy Vim features are not yet implemented:
|
||||||
|
|
||||||
- |if_lua|: Nvim Lua API is not compatible with Vim's "if_lua"
|
- *if_lua* : Nvim |Lua| API is not compatible with Vim's "if_lua"
|
||||||
- *if_mzscheme*
|
- *if_mzscheme*
|
||||||
- |if_py|: *python-bindeval* *python-Function* are not supported
|
- |if_pyth|: *python-bindeval* *python-Function* are not supported
|
||||||
- *if_tcl*
|
- *if_tcl*
|
||||||
|
|
||||||
|
*:gui*
|
||||||
|
*:gvim*
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
6. Removed features *nvim-features-removed*
|
6. Removed features *nvim-features-removed*
|
||||||
|
|
||||||
@@ -566,18 +569,18 @@ Highlight groups:
|
|||||||
<
|
<
|
||||||
|
|
||||||
Options:
|
Options:
|
||||||
'antialias'
|
antialias
|
||||||
*'balloondelay'* *'bdlay'*
|
*'balloondelay'* *'bdlay'*
|
||||||
*'ballooneval'* *'beval'* *'noballooneval'* *'nobeval'*
|
*'ballooneval'* *'beval'* *'noballooneval'* *'nobeval'*
|
||||||
*'balloonexpr'* *'bexpr'*
|
*'balloonexpr'* *'bexpr'*
|
||||||
'bioskey' (MS-DOS)
|
bioskey (MS-DOS)
|
||||||
'conskey' (MS-DOS)
|
conskey (MS-DOS)
|
||||||
*'cp'* *'nocompatible'* *'nocp'* *'compatible'* (Nvim is always "nocompatible".)
|
*'cp'* *'nocompatible'* *'nocp'* *'compatible'* (Nvim is always "nocompatible".)
|
||||||
'cpoptions' (gjkHw<*- and all POSIX flags were removed)
|
'cpoptions' (gjkHw<*- and all POSIX flags were removed)
|
||||||
*'cryptmethod'* *'cm'* *'key'* (Vim encryption implementation)
|
*'cryptmethod'* *'cm'* *'key'* (Vim encryption implementation)
|
||||||
*'ed'* *'edcompatible'* *'noed'* *'noedcompatible'*
|
*'ed'* *'edcompatible'* *'noed'* *'noedcompatible'*
|
||||||
'encoding' ("utf-8" is always used)
|
'encoding' ("utf-8" is always used)
|
||||||
'esckeys'
|
esckeys
|
||||||
'guioptions' "t" flag was removed
|
'guioptions' "t" flag was removed
|
||||||
*'guifontset'* *'gfs'* (Use 'guifont' instead.)
|
*'guifontset'* *'gfs'* (Use 'guifont' instead.)
|
||||||
*'guipty'* (Nvim uses pipes and PTYs consistently on all platforms.)
|
*'guipty'* (Nvim uses pipes and PTYs consistently on all platforms.)
|
||||||
@@ -618,18 +621,18 @@ Options:
|
|||||||
Nvim always displays up to 6 combining characters. You can still edit
|
Nvim always displays up to 6 combining characters. You can still edit
|
||||||
text with more than 6 combining characters, you just can't see them.
|
text with more than 6 combining characters, you just can't see them.
|
||||||
Use |g8| or |ga|. See |mbyte-combining|.
|
Use |g8| or |ga|. See |mbyte-combining|.
|
||||||
'maxmem' Nvim delegates memory-management to the OS.
|
*'maxmem'* Nvim delegates memory-management to the OS.
|
||||||
'maxmemtot' Nvim delegates memory-management to the OS.
|
*'maxmemtot'* Nvim delegates memory-management to the OS.
|
||||||
*'prompt'* *'noprompt'*
|
*'prompt'* *'noprompt'*
|
||||||
*'remap'* *'noremap'*
|
*'remap'* *'noremap'*
|
||||||
*'restorescreen'* *'rs'* *'norestorescreen'* *'nors'*
|
*'restorescreen'* *'rs'* *'norestorescreen'* *'nors'*
|
||||||
'shelltype'
|
*'shelltype'*
|
||||||
*'shortname'* *'sn'* *'noshortname'* *'nosn'*
|
*'shortname'* *'sn'* *'noshortname'* *'nosn'*
|
||||||
*'swapsync'* *'sws'*
|
*'swapsync'* *'sws'*
|
||||||
*'termencoding'* *'tenc'* (Vim 7.4.852 also removed this for Windows)
|
*'termencoding'* *'tenc'* (Vim 7.4.852 also removed this for Windows)
|
||||||
*'terse'* *'noterse'* (Add "s" to 'shortmess' instead)
|
*'terse'* *'noterse'* (Add "s" to 'shortmess' instead)
|
||||||
'textauto'
|
textauto
|
||||||
'textmode'
|
textmode
|
||||||
*'toolbar'* *'tb'*
|
*'toolbar'* *'tb'*
|
||||||
*'toolbariconsize'* *'tbis'*
|
*'toolbariconsize'* *'tbis'*
|
||||||
*'ttybuiltin'* *'tbi'* *'nottybuiltin'* *'notbi'*
|
*'ttybuiltin'* *'tbi'* *'nottybuiltin'* *'notbi'*
|
||||||
@@ -637,7 +640,7 @@ Options:
|
|||||||
*'ttymouse'* *'ttym'*
|
*'ttymouse'* *'ttym'*
|
||||||
*'ttyscroll'* *'tsl'*
|
*'ttyscroll'* *'tsl'*
|
||||||
*'ttytype'* *'tty'*
|
*'ttytype'* *'tty'*
|
||||||
'weirdinvert'
|
weirdinvert
|
||||||
|
|
||||||
Startup:
|
Startup:
|
||||||
--literal (file args are always literal; to expand wildcards on Windows, use
|
--literal (file args are always literal; to expand wildcards on Windows, use
|
||||||
|
@@ -401,7 +401,7 @@ end
|
|||||||
---@param bufnr number of buffer
|
---@param bufnr number of buffer
|
||||||
---@param pos1 (line, column) tuple marking beginning of region
|
---@param pos1 (line, column) tuple marking beginning of region
|
||||||
---@param pos2 (line, column) tuple marking end of region
|
---@param pos2 (line, column) tuple marking end of region
|
||||||
---@param regtype type of selection (:help setreg)
|
---@param regtype type of selection, see |setreg()|
|
||||||
---@param inclusive boolean indicating whether the selection is end-inclusive
|
---@param inclusive boolean indicating whether the selection is end-inclusive
|
||||||
---@return region lua table of the form {linenr = {startcol,endcol}}
|
---@return region lua table of the form {linenr = {startcol,endcol}}
|
||||||
function vim.region(bufnr, pos1, pos2, regtype, inclusive)
|
function vim.region(bufnr, pos1, pos2, regtype, inclusive)
|
||||||
@@ -448,7 +448,7 @@ end
|
|||||||
--- Defers calling `fn` until `timeout` ms passes.
|
--- Defers calling `fn` until `timeout` ms passes.
|
||||||
---
|
---
|
||||||
--- Use to do a one-shot timer that calls `fn`
|
--- Use to do a one-shot timer that calls `fn`
|
||||||
--- Note: The {fn} is |schedule_wrap|ped automatically, so API functions are
|
--- Note: The {fn} is |vim.schedule_wrap()|ped automatically, so API functions are
|
||||||
--- safe to call.
|
--- safe to call.
|
||||||
---@param fn Callback to call once `timeout` expires
|
---@param fn Callback to call once `timeout` expires
|
||||||
---@param timeout Number of milliseconds to wait before calling `fn`
|
---@param timeout Number of milliseconds to wait before calling `fn`
|
||||||
|
@@ -41,7 +41,7 @@ end
|
|||||||
---@param start first position (tuple {line,col})
|
---@param start first position (tuple {line,col})
|
||||||
---@param finish second position (tuple {line,col})
|
---@param finish second position (tuple {line,col})
|
||||||
---@param opts table with options:
|
---@param opts table with options:
|
||||||
-- - regtype type of range (:help setreg, default charwise)
|
-- - regtype type of range (see |setreg()|, default charwise)
|
||||||
-- - inclusive boolean indicating whether the range is end-inclusive (default false)
|
-- - inclusive boolean indicating whether the range is end-inclusive (default false)
|
||||||
-- - priority number indicating priority of highlight (default priorities.user)
|
-- - priority number indicating priority of highlight (default priorities.user)
|
||||||
function M.range(bufnr, ns, higroup, start, finish, opts)
|
function M.range(bufnr, ns, higroup, start, finish, opts)
|
||||||
|
@@ -823,7 +823,7 @@ end
|
|||||||
--- })
|
--- })
|
||||||
--- </pre>
|
--- </pre>
|
||||||
---
|
---
|
||||||
--- See |lsp.start_client| for all available options. The most important are:
|
--- See |vim.lsp.start_client()| for all available options. The most important are:
|
||||||
---
|
---
|
||||||
--- `name` is an arbitrary name for the LSP client. It should be unique per
|
--- `name` is an arbitrary name for the LSP client. It should be unique per
|
||||||
--- language server.
|
--- language server.
|
||||||
@@ -834,7 +834,7 @@ end
|
|||||||
---
|
---
|
||||||
--- `root_dir` path to the project root.
|
--- `root_dir` path to the project root.
|
||||||
--- By default this is used to decide if an existing client should be re-used.
|
--- By default this is used to decide if an existing client should be re-used.
|
||||||
--- The example above uses |vim.fs.find| and |vim.fs.dirname| to detect the
|
--- The example above uses |vim.fs.find()| and |vim.fs.dirname()| to detect the
|
||||||
--- root by traversing the file system upwards starting
|
--- root by traversing the file system upwards starting
|
||||||
--- from the current directory until either a `pyproject.toml` or `setup.py`
|
--- from the current directory until either a `pyproject.toml` or `setup.py`
|
||||||
--- file is found.
|
--- file is found.
|
||||||
@@ -849,11 +849,11 @@ end
|
|||||||
---
|
---
|
||||||
---
|
---
|
||||||
--- To ensure a language server is only started for languages it can handle,
|
--- To ensure a language server is only started for languages it can handle,
|
||||||
--- make sure to call |vim.lsp.start| within a |FileType| autocmd.
|
--- make sure to call |vim.lsp.start()| within a |FileType| autocmd.
|
||||||
--- Either use |:au|, |nvim_create_autocmd()| or put the call in a
|
--- Either use |:au|, |nvim_create_autocmd()| or put the call in a
|
||||||
--- `ftplugin/<filetype_name>.lua` (See |ftplugin-name|)
|
--- `ftplugin/<filetype_name>.lua` (See |ftplugin-name|)
|
||||||
---
|
---
|
||||||
---@param config table Same configuration as documented in |lsp.start_client()|
|
---@param config table Same configuration as documented in |vim.lsp.start_client()|
|
||||||
---@param opts nil|table Optional keyword arguments:
|
---@param opts nil|table Optional keyword arguments:
|
||||||
--- - reuse_client (fun(client: client, config: table): boolean)
|
--- - reuse_client (fun(client: client, config: table): boolean)
|
||||||
--- Predicate used to decide if a client should be re-used.
|
--- Predicate used to decide if a client should be re-used.
|
||||||
@@ -902,12 +902,12 @@ end
|
|||||||
---
|
---
|
||||||
---
|
---
|
||||||
---@param cmd: (table|string|fun(dispatchers: table):table) command string or
|
---@param cmd: (table|string|fun(dispatchers: table):table) command string or
|
||||||
--- list treated like |jobstart|. The command must launch the language server
|
--- list treated like |jobstart()|. The command must launch the language server
|
||||||
--- process. `cmd` can also be a function that creates an RPC client.
|
--- process. `cmd` can also be a function that creates an RPC client.
|
||||||
--- The function receives a dispatchers table and must return a table with the
|
--- The function receives a dispatchers table and must return a table with the
|
||||||
--- functions `request`, `notify`, `is_closing` and `terminate`
|
--- functions `request`, `notify`, `is_closing` and `terminate`
|
||||||
--- See |vim.lsp.rpc.request| and |vim.lsp.rpc.notify|
|
--- See |vim.lsp.rpc.request()| and |vim.lsp.rpc.notify()|
|
||||||
--- For TCP there is a built-in rpc client factory: |vim.lsp.rpc.connect|
|
--- For TCP there is a built-in rpc client factory: |vim.lsp.rpc.connect()|
|
||||||
---
|
---
|
||||||
---@param cmd_cwd: (string, default=|getcwd()|) Directory to launch
|
---@param cmd_cwd: (string, default=|getcwd()|) Directory to launch
|
||||||
--- the `cmd` process. Not related to `root_dir`.
|
--- the `cmd` process. Not related to `root_dir`.
|
||||||
@@ -963,7 +963,7 @@ end
|
|||||||
---@param on_error Callback with parameters (code, ...), invoked
|
---@param on_error Callback with parameters (code, ...), invoked
|
||||||
--- when the client operation throws an error. `code` is a number describing
|
--- 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
|
--- the error. Other arguments may be passed depending on the error kind. See
|
||||||
--- |vim.lsp.rpc.client_errors| for possible errors.
|
--- `vim.lsp.rpc.client_errors` for possible errors.
|
||||||
--- Use `vim.lsp.rpc.client_errors[code]` to get human-friendly name.
|
--- Use `vim.lsp.rpc.client_errors[code]` to get human-friendly name.
|
||||||
---
|
---
|
||||||
---@param before_init Callback with parameters (initialize_params, config)
|
---@param before_init Callback with parameters (initialize_params, config)
|
||||||
@@ -999,8 +999,8 @@ end
|
|||||||
--- notifications to the server by the given number in milliseconds. No debounce
|
--- notifications to the server by the given number in milliseconds. No debounce
|
||||||
--- occurs if nil
|
--- occurs if nil
|
||||||
--- - exit_timeout (number|boolean, default false): Milliseconds to wait for server to
|
--- - exit_timeout (number|boolean, default false): Milliseconds to wait for server to
|
||||||
--- exit cleanly after sending the 'shutdown' request before sending kill -15.
|
--- 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.
|
--- If set to false, nvim exits immediately after sending the "shutdown" request to the server.
|
||||||
---
|
---
|
||||||
---@param root_dir string Directory where the LSP
|
---@param root_dir string Directory where the LSP
|
||||||
--- server will base its workspaceFolders, rootUri, and rootPath
|
--- server will base its workspaceFolders, rootUri, and rootPath
|
||||||
@@ -1078,7 +1078,7 @@ function lsp.start_client(config)
|
|||||||
---
|
---
|
||||||
---@param code (number) Error code
|
---@param code (number) Error code
|
||||||
---@param err (...) Other arguments may be passed depending on the error kind
|
---@param err (...) Other arguments may be passed depending on the error kind
|
||||||
---@see |vim.lsp.rpc.client_errors| for possible errors. Use
|
---@see `vim.lsp.rpc.client_errors` for possible errors. Use
|
||||||
---`vim.lsp.rpc.client_errors[code]` to get a human-friendly name.
|
---`vim.lsp.rpc.client_errors[code]` to get a human-friendly name.
|
||||||
function dispatch.on_error(code, err)
|
function dispatch.on_error(code, err)
|
||||||
local _ = log.error()
|
local _ = log.error()
|
||||||
|
@@ -111,7 +111,7 @@ end
|
|||||||
--- about the context in which a completion was triggered (how it was triggered,
|
--- about the context in which a completion was triggered (how it was triggered,
|
||||||
--- and by which trigger character, if applicable)
|
--- and by which trigger character, if applicable)
|
||||||
---
|
---
|
||||||
---@see |vim.lsp.protocol.constants.CompletionTriggerKind|
|
---@see vim.lsp.protocol.constants.CompletionTriggerKind
|
||||||
function M.completion(context)
|
function M.completion(context)
|
||||||
local params = util.make_position_params()
|
local params = util.make_position_params()
|
||||||
params.context = context
|
params.context = context
|
||||||
@@ -317,7 +317,7 @@ end
|
|||||||
---
|
---
|
||||||
---@param options table|nil with valid `FormattingOptions` entries
|
---@param options table|nil with valid `FormattingOptions` entries
|
||||||
---@param timeout_ms (number) Request timeout
|
---@param timeout_ms (number) Request timeout
|
||||||
---@see |vim.lsp.buf.formatting_seq_sync|
|
---@see |vim.lsp.buf.format()|
|
||||||
function M.formatting_sync(options, timeout_ms)
|
function M.formatting_sync(options, timeout_ms)
|
||||||
vim.notify_once(
|
vim.notify_once(
|
||||||
'vim.lsp.buf.formatting_sync is deprecated. Use vim.lsp.buf.format instead',
|
'vim.lsp.buf.formatting_sync is deprecated. Use vim.lsp.buf.format instead',
|
||||||
@@ -614,14 +614,14 @@ end
|
|||||||
|
|
||||||
--- Lists all the call sites of the symbol under the cursor in the
|
--- Lists all the call sites of the symbol under the cursor in the
|
||||||
--- |quickfix| window. If the symbol can resolve to multiple
|
--- |quickfix| window. If the symbol can resolve to multiple
|
||||||
--- items, the user can pick one in the |inputlist|.
|
--- items, the user can pick one in the |inputlist()|.
|
||||||
function M.incoming_calls()
|
function M.incoming_calls()
|
||||||
call_hierarchy('callHierarchy/incomingCalls')
|
call_hierarchy('callHierarchy/incomingCalls')
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Lists all the items that are called by the symbol under the
|
--- Lists all the items that are called by the symbol under the
|
||||||
--- cursor in the |quickfix| window. If the symbol can resolve to
|
--- cursor in the |quickfix| window. If the symbol can resolve to
|
||||||
--- multiple items, the user can pick one in the |inputlist|.
|
--- multiple items, the user can pick one in the |inputlist()|.
|
||||||
function M.outgoing_calls()
|
function M.outgoing_calls()
|
||||||
call_hierarchy('callHierarchy/outgoingCalls')
|
call_hierarchy('callHierarchy/outgoingCalls')
|
||||||
end
|
end
|
||||||
@@ -730,9 +730,9 @@ end
|
|||||||
---
|
---
|
||||||
--- Note: Usage of |vim.lsp.buf.document_highlight()| requires the following highlight groups
|
--- Note: Usage of |vim.lsp.buf.document_highlight()| requires the following highlight groups
|
||||||
--- to be defined or you won't be able to see the actual highlights.
|
--- to be defined or you won't be able to see the actual highlights.
|
||||||
--- |LspReferenceText|
|
--- |hl-LspReferenceText|
|
||||||
--- |LspReferenceRead|
|
--- |hl-LspReferenceRead|
|
||||||
--- |LspReferenceWrite|
|
--- |hl-LspReferenceWrite|
|
||||||
function M.document_highlight()
|
function M.document_highlight()
|
||||||
local params = util.make_position_params()
|
local params = util.make_position_params()
|
||||||
request('textDocument/documentHighlight', params)
|
request('textDocument/documentHighlight', params)
|
||||||
|
@@ -389,7 +389,7 @@ M['textDocument/implementation'] = location_handler
|
|||||||
---@param config table Configuration table.
|
---@param config table Configuration table.
|
||||||
--- - border: (default=nil)
|
--- - border: (default=nil)
|
||||||
--- - Add borders to the floating window
|
--- - Add borders to the floating window
|
||||||
--- - See |vim.api.nvim_open_win()|
|
--- - See |nvim_open_win()|
|
||||||
function M.signature_help(_, result, ctx, config)
|
function M.signature_help(_, result, ctx, config)
|
||||||
config = config or {}
|
config = config or {}
|
||||||
config.focus_id = ctx.method
|
config.focus_id = ctx.method
|
||||||
|
@@ -635,7 +635,7 @@ end
|
|||||||
|
|
||||||
--- Starts an LSP server process and create an LSP RPC client object to
|
--- Starts an LSP server process and create an LSP RPC client object to
|
||||||
--- interact with it. Communication with the spawned process happens via stdio. For
|
--- interact with it. Communication with the spawned process happens via stdio. For
|
||||||
--- communication via TCP, spawn a process manually and use |vim.lsp.rpc.connect|
|
--- communication via TCP, spawn a process manually and use |vim.lsp.rpc.connect()|
|
||||||
---
|
---
|
||||||
---@param cmd (string) Command to start the LSP server.
|
---@param cmd (string) Command to start the LSP server.
|
||||||
---@param cmd_args (table) List of additional string arguments to pass to {cmd}.
|
---@param cmd_args (table) List of additional string arguments to pass to {cmd}.
|
||||||
|
@@ -1504,7 +1504,7 @@ end
|
|||||||
---
|
---
|
||||||
---@param contents table of lines to show in window
|
---@param contents table of lines to show in window
|
||||||
---@param syntax string of syntax to set for opened buffer
|
---@param syntax string of syntax to set for opened buffer
|
||||||
---@param opts table with optional fields (additional keys are passed on to |vim.api.nvim_open_win()|)
|
---@param opts table with optional fields (additional keys are passed on to |nvim_open_win()|)
|
||||||
--- - height: (number) height of floating window
|
--- - height: (number) height of floating window
|
||||||
--- - width: (number) width of floating window
|
--- - width: (number) width of floating window
|
||||||
--- - wrap: (boolean, default true) wrap long lines
|
--- - wrap: (boolean, default true) wrap long lines
|
||||||
@@ -1819,7 +1819,7 @@ end
|
|||||||
--- CAUTION: Modifies the input in-place!
|
--- CAUTION: Modifies the input in-place!
|
||||||
---
|
---
|
||||||
---@param lines (table) list of lines
|
---@param lines (table) list of lines
|
||||||
---@returns (string) filetype or 'markdown' if it was unchanged.
|
---@returns (string) filetype or "markdown" if it was unchanged.
|
||||||
function M.try_trim_markdown_code_blocks(lines)
|
function M.try_trim_markdown_code_blocks(lines)
|
||||||
local language_id = lines[1]:match('^```(.*)')
|
local language_id = lines[1]:match('^```(.*)')
|
||||||
if language_id then
|
if language_id then
|
||||||
@@ -1992,7 +1992,7 @@ function M.make_workspace_params(added, removed)
|
|||||||
end
|
end
|
||||||
--- Returns indentation size.
|
--- Returns indentation size.
|
||||||
---
|
---
|
||||||
---@see |shiftwidth|
|
---@see 'shiftwidth'
|
||||||
---@param bufnr (number|nil): Buffer handle, defaults to current
|
---@param bufnr (number|nil): Buffer handle, defaults to current
|
||||||
---@returns (number) indentation size
|
---@returns (number) indentation size
|
||||||
function M.get_effective_tabstop(bufnr)
|
function M.get_effective_tabstop(bufnr)
|
||||||
|
@@ -302,7 +302,7 @@ end
|
|||||||
|
|
||||||
--- Merges recursively two or more map-like tables.
|
--- Merges recursively two or more map-like tables.
|
||||||
---
|
---
|
||||||
---@see |tbl_extend()|
|
---@see |vim.tbl_extend()|
|
||||||
---
|
---
|
||||||
---@param behavior string Decides what to do if a key is found in more than one map:
|
---@param behavior string Decides what to do if a key is found in more than one map:
|
||||||
--- - "error": raise an error
|
--- - "error": raise an error
|
||||||
|
@@ -54,7 +54,7 @@ end
|
|||||||
--- Gets the list of files used to make up a query
|
--- Gets the list of files used to make up a query
|
||||||
---
|
---
|
||||||
---@param lang string Language to get query for
|
---@param lang string Language to get query for
|
||||||
---@param query_name string Name of the query to load (e.g., 'highlights')
|
---@param query_name string Name of the query to load (e.g., "highlights")
|
||||||
---@param is_included (boolean|nil) Internal parameter, most of the time left as `nil`
|
---@param is_included (boolean|nil) Internal parameter, most of the time left as `nil`
|
||||||
---@return string[] query_files List of files to load for given query and language
|
---@return string[] query_files List of files to load for given query and language
|
||||||
function M.get_query_files(lang, query_name, is_included)
|
function M.get_query_files(lang, query_name, is_included)
|
||||||
@@ -162,7 +162,7 @@ local explicit_queries = setmetatable({}, {
|
|||||||
--- set by plugins.
|
--- set by plugins.
|
||||||
---
|
---
|
||||||
---@param lang string Language to use for the query
|
---@param lang string Language to use for the query
|
||||||
---@param query_name string Name of the query (e.g., 'highlights')
|
---@param query_name string Name of the query (e.g., "highlights")
|
||||||
---@param text string Query text (unparsed).
|
---@param text string Query text (unparsed).
|
||||||
function M.set_query(lang, query_name, text)
|
function M.set_query(lang, query_name, text)
|
||||||
explicit_queries[lang][query_name] = M.parse_query(lang, text)
|
explicit_queries[lang][query_name] = M.parse_query(lang, text)
|
||||||
@@ -171,7 +171,7 @@ end
|
|||||||
--- Returns the runtime query {query_name} for {lang}.
|
--- Returns the runtime query {query_name} for {lang}.
|
||||||
---
|
---
|
||||||
---@param lang string Language to use for the query
|
---@param lang string Language to use for the query
|
||||||
---@param query_name string Name of the query (e.g. 'highlights')
|
---@param query_name string Name of the query (e.g. "highlights")
|
||||||
---
|
---
|
||||||
---@return Query Parsed query
|
---@return Query Parsed query
|
||||||
function M.get_query(lang, query_name)
|
function M.get_query(lang, query_name)
|
||||||
@@ -596,7 +596,7 @@ end
|
|||||||
--- Iterates the matches of self on a given range.
|
--- Iterates the matches of self on a given range.
|
||||||
---
|
---
|
||||||
--- Iterate over all matches within a {node}. The arguments are the same as
|
--- Iterate over all matches within a {node}. The arguments are the same as
|
||||||
--- for |query:iter_captures()| but the iterated values are different:
|
--- for |Query:iter_captures()| but the iterated values are different:
|
||||||
--- an (1-based) index of the pattern in the query, a table mapping
|
--- an (1-based) index of the pattern in the query, a table mapping
|
||||||
--- capture indices to nodes, and metadata from any directives processing the match.
|
--- capture indices to nodes, and metadata from any directives processing the match.
|
||||||
--- If the query has more than one pattern, the capture table might be sparse
|
--- If the query has more than one pattern, the capture table might be sparse
|
||||||
|
@@ -599,7 +599,7 @@ void nvim_del_autocmd(Integer id, Error *err)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Clear all autocommands that match the corresponding {opts}. To delete
|
/// Clear all autocommands that match the corresponding {opts}. To delete
|
||||||
/// a particular autocmd, see |nvim_del_autocmd|.
|
/// a particular autocmd, see |nvim_del_autocmd()|.
|
||||||
/// @param opts Parameters
|
/// @param opts Parameters
|
||||||
/// - event: (string|table)
|
/// - event: (string|table)
|
||||||
/// Examples:
|
/// Examples:
|
||||||
@@ -728,7 +728,7 @@ Integer nvim_create_augroup(uint64_t channel_id, String name, Dict(create_augrou
|
|||||||
///
|
///
|
||||||
/// To get a group id one can use |nvim_get_autocmds()|.
|
/// To get a group id one can use |nvim_get_autocmds()|.
|
||||||
///
|
///
|
||||||
/// NOTE: behavior differs from |augroup-delete|. When deleting a group, autocommands contained in
|
/// NOTE: behavior differs from |:augroup-delete|. When deleting a group, autocommands contained in
|
||||||
/// this group will also be deleted and cleared. This group will no longer exist.
|
/// this group will also be deleted and cleared. This group will no longer exist.
|
||||||
/// @param id Integer The id of the group.
|
/// @param id Integer The id of the group.
|
||||||
/// @see |nvim_del_augroup_by_name()|
|
/// @see |nvim_del_augroup_by_name()|
|
||||||
@@ -746,10 +746,10 @@ void nvim_del_augroup_by_id(Integer id, Error *err)
|
|||||||
|
|
||||||
/// Delete an autocommand group by name.
|
/// Delete an autocommand group by name.
|
||||||
///
|
///
|
||||||
/// NOTE: behavior differs from |augroup-delete|. When deleting a group, autocommands contained in
|
/// NOTE: behavior differs from |:augroup-delete|. When deleting a group, autocommands contained in
|
||||||
/// this group will also be deleted and cleared. This group will no longer exist.
|
/// this group will also be deleted and cleared. This group will no longer exist.
|
||||||
/// @param name String The name of the group.
|
/// @param name String The name of the group.
|
||||||
/// @see |autocommand-groups|
|
/// @see |autocmd-groups|
|
||||||
void nvim_del_augroup_by_name(String name, Error *err)
|
void nvim_del_augroup_by_name(String name, Error *err)
|
||||||
FUNC_API_SINCE(9)
|
FUNC_API_SINCE(9)
|
||||||
{
|
{
|
||||||
|
@@ -393,7 +393,7 @@ Array nvim_buf_get_extmarks(Buffer buffer, Integer ns_id, Object start, Object e
|
|||||||
/// multiple highlight groups that will be stacked
|
/// multiple highlight groups that will be stacked
|
||||||
/// (highest priority last). A highlight group can be supplied
|
/// (highest priority last). A highlight group can be supplied
|
||||||
/// either as a string or as an integer, the latter which
|
/// either as a string or as an integer, the latter which
|
||||||
/// can be obtained using |nvim_get_hl_id_by_name|.
|
/// can be obtained using |nvim_get_hl_id_by_name()|.
|
||||||
/// - virt_text_pos : position of virtual text. Possible values:
|
/// - virt_text_pos : position of virtual text. Possible values:
|
||||||
/// - "eol": right after eol character (default)
|
/// - "eol": right after eol character (default)
|
||||||
/// - "overlay": display over the specified column, without
|
/// - "overlay": display over the specified column, without
|
||||||
@@ -430,7 +430,7 @@ Array nvim_buf_get_extmarks(Buffer buffer, Integer ns_id, Object start, Object e
|
|||||||
/// column of the window, bypassing
|
/// column of the window, bypassing
|
||||||
/// sign and number columns.
|
/// sign and number columns.
|
||||||
///
|
///
|
||||||
/// - ephemeral : for use with |nvim_set_decoration_provider|
|
/// - ephemeral : for use with |nvim_set_decoration_provider()|
|
||||||
/// callbacks. The mark will only be used for the current
|
/// callbacks. The mark will only be used for the current
|
||||||
/// redraw cycle, and not be permantently stored in the
|
/// redraw cycle, and not be permantently stored in the
|
||||||
/// buffer.
|
/// buffer.
|
||||||
@@ -958,7 +958,7 @@ void nvim_buf_clear_namespace(Buffer buffer, Integer ns_id, Integer line_start,
|
|||||||
/// being triggered during the redraw code.
|
/// being triggered during the redraw code.
|
||||||
///
|
///
|
||||||
/// The expected usage is to set extmarks for the currently
|
/// The expected usage is to set extmarks for the currently
|
||||||
/// redrawn buffer. |nvim_buf_set_extmark| can be called to add marks
|
/// redrawn buffer. |nvim_buf_set_extmark()| can be called to add marks
|
||||||
/// on a per-window or per-lines basis. Use the `ephemeral` key to only
|
/// on a per-window or per-lines basis. Use the `ephemeral` key to only
|
||||||
/// use the mark for the current screen redraw (the callback will be called
|
/// use the mark for the current screen redraw (the callback will be called
|
||||||
/// again for the next redraw ).
|
/// again for the next redraw ).
|
||||||
|
@@ -147,7 +147,7 @@ Object nvim_get_option_value(String name, Dict(option) *opts, Error *err)
|
|||||||
/// @param name Option name
|
/// @param name Option name
|
||||||
/// @param value New option value
|
/// @param value New option value
|
||||||
/// @param opts Optional parameters
|
/// @param opts Optional parameters
|
||||||
/// - scope: One of 'global' or 'local'. Analogous to
|
/// - scope: One of "global" or "local". Analogous to
|
||||||
/// |:setglobal| and |:setlocal|, respectively.
|
/// |:setglobal| and |:setlocal|, respectively.
|
||||||
/// - win: |window-ID|. Used for setting window local option.
|
/// - win: |window-ID|. Used for setting window local option.
|
||||||
/// - buf: Buffer number. Used for setting buffer local option.
|
/// - buf: Buffer number. Used for setting buffer local option.
|
||||||
@@ -202,7 +202,7 @@ void nvim_set_option_value(String name, Object value, Dict(option) *opts, Error
|
|||||||
/// Gets the option information for all options.
|
/// Gets the option information for all options.
|
||||||
///
|
///
|
||||||
/// The dictionary has the full option names as keys and option metadata
|
/// The dictionary has the full option names as keys and option metadata
|
||||||
/// dictionaries as detailed at |nvim_get_option_info|.
|
/// dictionaries as detailed at |nvim_get_option_info()|.
|
||||||
///
|
///
|
||||||
/// @return dictionary of all options
|
/// @return dictionary of all options
|
||||||
Dictionary nvim_get_all_options_info(Error *err)
|
Dictionary nvim_get_all_options_info(Error *err)
|
||||||
|
@@ -160,8 +160,8 @@ Dictionary nvim__get_hl_defs(Integer ns_id, Arena *arena, Error *err)
|
|||||||
/// - nocombine: boolean
|
/// - nocombine: boolean
|
||||||
/// - link: name of another highlight group to link to, see |:hi-link|.
|
/// - link: name of another highlight group to link to, see |:hi-link|.
|
||||||
/// - default: Don't override existing definition |:hi-default|
|
/// - default: Don't override existing definition |:hi-default|
|
||||||
/// - ctermfg: Sets foreground of cterm color |highlight-ctermfg|
|
/// - ctermfg: Sets foreground of cterm color |ctermfg|
|
||||||
/// - ctermbg: Sets background of cterm color |highlight-ctermbg|
|
/// - ctermbg: Sets background of cterm color |ctermbg|
|
||||||
/// - cterm: cterm attribute map, like |highlight-args|. If not set,
|
/// - cterm: cterm attribute map, like |highlight-args|. If not set,
|
||||||
/// cterm attributes will match those from the attribute map
|
/// cterm attributes will match those from the attribute map
|
||||||
/// documented above.
|
/// documented above.
|
||||||
@@ -185,7 +185,7 @@ void nvim_set_hl(Integer ns_id, String name, Dict(highlight) *val, Error *err)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Set active namespace for highlights. This can be set for a single window,
|
/// Set active namespace for highlights. This can be set for a single window,
|
||||||
/// see |nvim_win_set_hl_ns|.
|
/// see |nvim_win_set_hl_ns()|.
|
||||||
///
|
///
|
||||||
/// @param ns_id the namespace to use
|
/// @param ns_id the namespace to use
|
||||||
/// @param[out] err Error details, if any
|
/// @param[out] err Error details, if any
|
||||||
@@ -205,7 +205,7 @@ void nvim_set_hl_ns(Integer ns_id, Error *err)
|
|||||||
/// Set active namespace for highlights while redrawing.
|
/// Set active namespace for highlights while redrawing.
|
||||||
///
|
///
|
||||||
/// This function meant to be called while redrawing, primarily from
|
/// This function meant to be called while redrawing, primarily from
|
||||||
/// |nvim_set_decoration_provider| on_win and on_line callbacks, which
|
/// |nvim_set_decoration_provider()| on_win and on_line callbacks, which
|
||||||
/// are allowed to change the namespace during a redraw cycle.
|
/// are allowed to change the namespace during a redraw cycle.
|
||||||
///
|
///
|
||||||
/// @param ns_id the namespace to activate
|
/// @param ns_id the namespace to activate
|
||||||
@@ -523,7 +523,7 @@ Array nvim__runtime_inspect(void)
|
|||||||
|
|
||||||
/// Find files in runtime directories
|
/// Find files in runtime directories
|
||||||
///
|
///
|
||||||
/// 'name' can contain wildcards. For example
|
/// "name" can contain wildcards. For example
|
||||||
/// nvim_get_runtime_file("colors/*.vim", true) will return all color
|
/// nvim_get_runtime_file("colors/*.vim", true) will return all color
|
||||||
/// scheme files. Always use forward slashes (/) in the search pattern for
|
/// scheme files. Always use forward slashes (/) in the search pattern for
|
||||||
/// subdirectories regardless of platform.
|
/// subdirectories regardless of platform.
|
||||||
@@ -964,7 +964,7 @@ fail:
|
|||||||
/// mode. Note: keypresses are sent raw as they would be to the pty
|
/// mode. Note: keypresses are sent raw as they would be to the pty
|
||||||
/// master end. For instance, a carriage return is sent
|
/// master end. For instance, a carriage return is sent
|
||||||
/// as a "\r", not as a "\n". |textlock| applies. It is possible
|
/// as a "\r", not as a "\n". |textlock| applies. It is possible
|
||||||
/// to call |nvim_chan_send| directly in the callback however.
|
/// to call |nvim_chan_send()| directly in the callback however.
|
||||||
/// ["input", term, bufnr, data]
|
/// ["input", term, bufnr, data]
|
||||||
/// @param[out] err Error details, if any
|
/// @param[out] err Error details, if any
|
||||||
/// @return Channel id, or 0 on error
|
/// @return Channel id, or 0 on error
|
||||||
@@ -1452,7 +1452,7 @@ ArrayOf(Dictionary) nvim_get_keymap(String mode)
|
|||||||
/// @param rhs Right-hand-side |{rhs}| of the mapping.
|
/// @param rhs Right-hand-side |{rhs}| of the mapping.
|
||||||
/// @param opts Optional parameters map: keys are |:map-arguments|, values are booleans (default
|
/// @param opts Optional parameters map: keys are |:map-arguments|, values are booleans (default
|
||||||
/// false). Accepts all |:map-arguments| as keys excluding |<buffer>| but including
|
/// false). Accepts all |:map-arguments| as keys excluding |<buffer>| but including
|
||||||
/// |noremap| and "desc". Unknown key is an error.
|
/// |:noremap| and "desc". Unknown key is an error.
|
||||||
/// "desc" can be used to give a description to the mapping.
|
/// "desc" can be used to give a description to the mapping.
|
||||||
/// When called from Lua, also accepts a "callback" key that takes a Lua function to
|
/// When called from Lua, also accepts a "callback" key that takes a Lua function to
|
||||||
/// call when the mapping is executed.
|
/// call when the mapping is executed.
|
||||||
|
@@ -109,7 +109,7 @@
|
|||||||
/// is changed to `auto` and 'colorcolumn' is cleared. The
|
/// is changed to `auto` and 'colorcolumn' is cleared. The
|
||||||
/// end-of-buffer region is hidden by setting `eob` flag of
|
/// end-of-buffer region is hidden by setting `eob` flag of
|
||||||
/// 'fillchars' to a space char, and clearing the
|
/// 'fillchars' to a space char, and clearing the
|
||||||
/// |EndOfBuffer| region in 'winhighlight'.
|
/// |hl-EndOfBuffer| region in 'winhighlight'.
|
||||||
/// - border: Style of (optional) window border. This can either be a string
|
/// - border: Style of (optional) window border. This can either be a string
|
||||||
/// or an array. The string values are
|
/// or an array. The string values are
|
||||||
/// - "none": No border (default).
|
/// - "none": No border (default).
|
||||||
|
@@ -340,7 +340,7 @@ Boolean nvim_win_is_valid(Window window)
|
|||||||
///
|
///
|
||||||
/// Like |:hide| the buffer becomes hidden unless another window is editing it,
|
/// Like |:hide| the buffer becomes hidden unless another window is editing it,
|
||||||
/// or 'bufhidden' is `unload`, `delete` or `wipe` as opposed to |:close| or
|
/// or 'bufhidden' is `unload`, `delete` or `wipe` as opposed to |:close| or
|
||||||
/// |nvim_win_close|, which will close the buffer.
|
/// |nvim_win_close()|, which will close the buffer.
|
||||||
///
|
///
|
||||||
/// @param window Window handle, or 0 for current window
|
/// @param window Window handle, or 0 for current window
|
||||||
/// @param[out] err Error details, if any
|
/// @param[out] err Error details, if any
|
||||||
|
@@ -890,7 +890,7 @@ theend:
|
|||||||
///
|
///
|
||||||
/// @param maptype MAPTYPE_MAP for |:map|
|
/// @param maptype MAPTYPE_MAP for |:map|
|
||||||
/// MAPTYPE_UNMAP for |:unmap|
|
/// MAPTYPE_UNMAP for |:unmap|
|
||||||
/// MAPTYPE_NOREMAP for |noremap|.
|
/// MAPTYPE_NOREMAP for |:noremap|.
|
||||||
/// @param arg C-string containing the arguments of the map/abbrev
|
/// @param arg C-string containing the arguments of the map/abbrev
|
||||||
/// command, i.e. everything except the initial `:[X][nore]map`.
|
/// command, i.e. everything except the initial `:[X][nore]map`.
|
||||||
/// - Cannot be a read-only string; it will be modified.
|
/// - Cannot be a read-only string; it will be modified.
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
/// All possible |:map-arguments| usable in a |:map| command.
|
/// All possible |:map-arguments| usable in a |:map| command.
|
||||||
///
|
///
|
||||||
/// The <special> argument has no effect on mappings and is excluded from this
|
/// The <special> argument has no effect on mappings and is excluded from this
|
||||||
/// struct declaration. |noremap| is included, since it behaves like a map
|
/// struct declaration. |:noremap| is included, since it behaves like a map
|
||||||
/// argument when used in a mapping.
|
/// argument when used in a mapping.
|
||||||
///
|
///
|
||||||
/// @see mapblock_T
|
/// @see mapblock_T
|
||||||
|
Reference in New Issue
Block a user