mirror of
https://github.com/neovim/neovim.git
synced 2025-09-26 21:18:34 +00:00
docs: various clarifications (#23999)
Close #18907 Close #20314 Close #23749
This commit is contained in:
@@ -1495,7 +1495,7 @@ nvim_set_keymap({mode}, {lhs}, {rhs}, {*opts}) *nvim_set_keymap()*
|
|||||||
except |<buffer>|, values are booleans (default false). Also:
|
except |<buffer>|, values are booleans (default false). Also:
|
||||||
• "noremap" non-recursive mapping |:noremap|
|
• "noremap" non-recursive mapping |:noremap|
|
||||||
• "desc" human-readable description.
|
• "desc" human-readable description.
|
||||||
• "callback" Lua function called when the mapping is executed.
|
• "callback" Lua function called in place of {rhs}.
|
||||||
• "replace_keycodes" (boolean) When "expr" is true, replace
|
• "replace_keycodes" (boolean) When "expr" is true, replace
|
||||||
keycodes in the resulting string (see
|
keycodes in the resulting string (see
|
||||||
|nvim_replace_termcodes()|). Returning nil from the Lua
|
|nvim_replace_termcodes()|). Returning nil from the Lua
|
||||||
|
@@ -867,21 +867,6 @@ vim.schedule({callback}) *vim.schedule()*
|
|||||||
Schedules {callback} to be invoked soon by the main event-loop. Useful
|
Schedules {callback} to be invoked soon by the main event-loop. Useful
|
||||||
to avoid |textlock| or other temporary restrictions.
|
to avoid |textlock| or other temporary restrictions.
|
||||||
|
|
||||||
|
|
||||||
vim.defer_fn({fn}, {timeout}) *vim.defer_fn*
|
|
||||||
Defers calling {fn} until {timeout} ms passes. Use to do a one-shot timer
|
|
||||||
that calls {fn}.
|
|
||||||
|
|
||||||
Note: The {fn} is |vim.schedule_wrap()|ped automatically, so API functions are
|
|
||||||
safe to call.
|
|
||||||
|
|
||||||
Parameters: ~
|
|
||||||
• {fn} Callback to call once {timeout} expires
|
|
||||||
• {timeout} Time in ms to wait before calling {fn}
|
|
||||||
|
|
||||||
Returns: ~
|
|
||||||
|vim.uv|.new_timer() object
|
|
||||||
|
|
||||||
vim.wait({time} [, {callback}, {interval}, {fast_only}]) *vim.wait()*
|
vim.wait({time} [, {callback}, {interval}, {fast_only}]) *vim.wait()*
|
||||||
Wait for {time} in milliseconds until {callback} returns `true`.
|
Wait for {time} in milliseconds until {callback} returns `true`.
|
||||||
|
|
||||||
@@ -1376,10 +1361,10 @@ connection_failure_errmsg({consequence})
|
|||||||
TODO: Documentation
|
TODO: Documentation
|
||||||
|
|
||||||
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 |vim.schedule_wrap()|ped automatically, so API functions
|
Use to do a one-shot timer that calls {fn} Note: The {fn} is
|
||||||
are safe to call.
|
|vim.schedule_wrap()|ped automatically, so API functions are safe to call.
|
||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
• {fn} (function) Callback to call once `timeout` expires
|
• {fn} (function) Callback to call once `timeout` expires
|
||||||
@@ -2551,8 +2536,8 @@ del({modes}, {lhs}, {opts}) *vim.keymap.del()*
|
|||||||
|
|
||||||
Parameters: ~
|
Parameters: ~
|
||||||
• {opts} (table|nil) A table of optional arguments:
|
• {opts} (table|nil) A table of optional arguments:
|
||||||
• buffer: (number or boolean) Remove a mapping from the given
|
• "buffer": (number|boolean) Remove a mapping from the given
|
||||||
buffer. When "true" or 0, use the current buffer.
|
buffer. When `0` or `true`, use the current buffer.
|
||||||
|
|
||||||
See also: ~
|
See also: ~
|
||||||
• |vim.keymap.set()|
|
• |vim.keymap.set()|
|
||||||
@@ -2586,9 +2571,9 @@ set({mode}, {lhs}, {rhs}, {opts}) *vim.keymap.set()*
|
|||||||
• "noremap": inverse of "remap" (see below).
|
• "noremap": inverse of "remap" (see below).
|
||||||
|
|
||||||
• Also accepts:
|
• Also accepts:
|
||||||
• "buffer" number|boolean Creates buffer-local mapping, `0`
|
• "buffer": (number|boolean) Creates buffer-local mapping,
|
||||||
or `true` for current buffer.
|
`0` or `true` for current buffer.
|
||||||
• remap: (boolean) Make the mapping recursive. Inverses
|
• "remap": (boolean) Make the mapping recursive. Inverse of
|
||||||
"noremap". Defaults to `false`.
|
"noremap". Defaults to `false`.
|
||||||
|
|
||||||
See also: ~
|
See also: ~
|
||||||
|
@@ -1391,7 +1391,7 @@ completion can be enabled:
|
|||||||
-complete=highlight highlight groups
|
-complete=highlight highlight groups
|
||||||
-complete=history :history suboptions
|
-complete=history :history suboptions
|
||||||
-complete=locale locale names (as output of locale -a)
|
-complete=locale locale names (as output of locale -a)
|
||||||
-complete=lua Lua expression
|
-complete=lua Lua expression |:lua|
|
||||||
-complete=mapclear buffer argument
|
-complete=mapclear buffer argument
|
||||||
-complete=mapping mapping name
|
-complete=mapping mapping name
|
||||||
-complete=menu menus
|
-complete=menu menus
|
||||||
|
@@ -762,7 +762,7 @@ TUI:
|
|||||||
|
|
||||||
Cscope:
|
Cscope:
|
||||||
*cscope*
|
*cscope*
|
||||||
Cscope support has been removed in favour of LSP based solutions.
|
Cscope support has been removed in favour of plugin-based solutions.
|
||||||
|
|
||||||
Hardcopy:
|
Hardcopy:
|
||||||
*hardcopy*
|
*hardcopy*
|
||||||
|
@@ -534,9 +534,9 @@ function vim.region(bufnr, pos1, pos2, regtype, inclusive)
|
|||||||
return region
|
return region
|
||||||
end
|
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 |vim.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 function Callback to call once `timeout` expires
|
---@param fn function Callback to call once `timeout` expires
|
||||||
|
@@ -27,9 +27,9 @@ local keymap = {}
|
|||||||
--- - "replace_keycodes" defaults to `true` if "expr" is `true`.
|
--- - "replace_keycodes" defaults to `true` if "expr" is `true`.
|
||||||
--- - "noremap": inverse of "remap" (see below).
|
--- - "noremap": inverse of "remap" (see below).
|
||||||
--- - Also accepts:
|
--- - Also accepts:
|
||||||
--- - "buffer" number|boolean Creates buffer-local mapping, `0` or `true`
|
--- - "buffer": (number|boolean) Creates buffer-local mapping, `0` or `true`
|
||||||
--- for current buffer.
|
--- for current buffer.
|
||||||
--- - remap: (boolean) Make the mapping recursive. Inverses "noremap".
|
--- - "remap": (boolean) Make the mapping recursive. Inverse of "noremap".
|
||||||
--- Defaults to `false`.
|
--- Defaults to `false`.
|
||||||
---@see |nvim_set_keymap()|
|
---@see |nvim_set_keymap()|
|
||||||
function keymap.set(mode, lhs, rhs, opts)
|
function keymap.set(mode, lhs, rhs, opts)
|
||||||
@@ -83,8 +83,8 @@ end
|
|||||||
--- vim.keymap.del({'n', 'i', 'v'}, '<leader>w', { buffer = 5 })
|
--- vim.keymap.del({'n', 'i', 'v'}, '<leader>w', { buffer = 5 })
|
||||||
--- </pre>
|
--- </pre>
|
||||||
---@param opts table|nil A table of optional arguments:
|
---@param opts table|nil A table of optional arguments:
|
||||||
--- - buffer: (number or boolean) Remove a mapping from the given buffer.
|
--- - "buffer": (number|boolean) Remove a mapping from the given buffer.
|
||||||
--- When "true" or 0, use the current buffer.
|
--- When `0` or `true`, use the current buffer.
|
||||||
---@see |vim.keymap.set()|
|
---@see |vim.keymap.set()|
|
||||||
---
|
---
|
||||||
function keymap.del(modes, lhs, opts)
|
function keymap.del(modes, lhs, opts)
|
||||||
|
@@ -1427,7 +1427,7 @@ ArrayOf(Dictionary) nvim_get_keymap(String mode)
|
|||||||
/// values are booleans (default false). Also:
|
/// values are booleans (default false). Also:
|
||||||
/// - "noremap" non-recursive mapping |:noremap|
|
/// - "noremap" non-recursive mapping |:noremap|
|
||||||
/// - "desc" human-readable description.
|
/// - "desc" human-readable description.
|
||||||
/// - "callback" Lua function called when the mapping is executed.
|
/// - "callback" Lua function called in place of {rhs}.
|
||||||
/// - "replace_keycodes" (boolean) When "expr" is true, replace keycodes in the
|
/// - "replace_keycodes" (boolean) When "expr" is true, replace keycodes in the
|
||||||
/// resulting string (see |nvim_replace_termcodes()|). Returning nil from the Lua
|
/// resulting string (see |nvim_replace_termcodes()|). Returning nil from the Lua
|
||||||
/// "callback" is equivalent to returning an empty string.
|
/// "callback" is equivalent to returning an empty string.
|
||||||
|
Reference in New Issue
Block a user