mirror of
https://github.com/neovim/neovim.git
synced 2025-12-10 16:42:42 +00:00
doc: Enhance documentation
This commit is contained in:
@@ -2140,6 +2140,7 @@ lispindent({lnum}) Number Lisp indent for line {lnum}
|
|||||||
localtime() Number current time
|
localtime() Number current time
|
||||||
log({expr}) Float natural logarithm (base e) of {expr}
|
log({expr}) Float natural logarithm (base e) of {expr}
|
||||||
log10({expr}) Float logarithm of Float {expr} to base 10
|
log10({expr}) Float logarithm of Float {expr} to base 10
|
||||||
|
luaeval({expr}[, {expr}]) any evaluate Lua expression
|
||||||
map({expr}, {string}) List/Dict change each item in {expr} to {expr}
|
map({expr}, {string}) List/Dict change each item in {expr} to {expr}
|
||||||
maparg({name}[, {mode} [, {abbr} [, {dict}]]])
|
maparg({name}[, {mode} [, {abbr} [, {dict}]]])
|
||||||
String or Dict
|
String or Dict
|
||||||
@@ -5095,6 +5096,9 @@ log10({expr}) *log10()*
|
|||||||
:echo log10(0.01)
|
:echo log10(0.01)
|
||||||
< -2.0
|
< -2.0
|
||||||
|
|
||||||
|
luaeval({expr}[, {expr}])
|
||||||
|
Evaluate Lua expression {expr} and return its result converted
|
||||||
|
to Vim data structures. See |lua-luaeval| for more details.
|
||||||
|
|
||||||
map({expr1}, {expr2}) *map()*
|
map({expr1}, {expr2}) *map()*
|
||||||
{expr1} must be a |List| or a |Dictionary|.
|
{expr1} must be a |List| or a |Dictionary|.
|
||||||
|
|||||||
@@ -114,8 +114,9 @@ functions may be found in |api-funcs.txt|.
|
|||||||
*luaeval()*
|
*luaeval()*
|
||||||
|
|
||||||
The (dual) equivalent of "vim.eval" for passing Lua values to Vim is
|
The (dual) equivalent of "vim.eval" for passing Lua values to Vim is
|
||||||
"luaeval". "luaeval" takes an expression string and an optional argument and
|
"luaeval". "luaeval" takes an expression string and an optional argument used
|
||||||
returns the result of the expression. It is semantically equivalent in Lua to:
|
for _A inside expression and returns the result of the expression. It is
|
||||||
|
semantically equivalent in Lua to:
|
||||||
>
|
>
|
||||||
local chunkheader = "local _A = select(1, ...) return "
|
local chunkheader = "local _A = select(1, ...) return "
|
||||||
function luaeval (expstr, arg)
|
function luaeval (expstr, arg)
|
||||||
@@ -129,8 +130,8 @@ thrown if conversion of any of the remaining Lua types is attempted.
|
|||||||
|
|
||||||
Note 2: lua tables are used as both dictionaries and lists, thus making it
|
Note 2: lua tables are used as both dictionaries and lists, thus making it
|
||||||
impossible to determine whether empty table is meant to be empty list or empty
|
impossible to determine whether empty table is meant to be empty list or empty
|
||||||
dictionary. To distinguish between these cases there is the following
|
dictionary. Additionally lua does not have integer numbers. To distinguish
|
||||||
agreement:
|
between these cases there is the following agreement:
|
||||||
|
|
||||||
0. Empty table is empty list.
|
0. Empty table is empty list.
|
||||||
1. Table with N incrementally growing integral numbers, starting from 1 and
|
1. Table with N incrementally growing integral numbers, starting from 1 and
|
||||||
@@ -165,9 +166,9 @@ Examples: >
|
|||||||
:echo Rand(1,10)
|
:echo Rand(1,10)
|
||||||
|
|
||||||
Note that currently second argument to `luaeval` undergoes VimL to lua
|
Note that currently second argument to `luaeval` undergoes VimL to lua
|
||||||
conversion, so changing resulting containers in lua do not affect values in
|
conversion, so changing containers in lua do not affect values in VimL. Return
|
||||||
VimL. Return value is also always converted. When converting,
|
value is also always converted. When converting, |msgpack-special-dict|s are
|
||||||
|msgpack-special-dict|s are treated specially.
|
treated specially.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
vim:tw=78:ts=8:noet:ft=help:norl:
|
vim:tw=78:ts=8:noet:ft=help:norl:
|
||||||
|
|||||||
@@ -1339,6 +1339,9 @@ tag command action ~
|
|||||||
|:ltag| :lt[ag] jump to tag and add matching tags to the
|
|:ltag| :lt[ag] jump to tag and add matching tags to the
|
||||||
location list
|
location list
|
||||||
|:lunmap| :lu[nmap] like ":unmap!" but includes Lang-Arg mode
|
|:lunmap| :lu[nmap] like ":unmap!" but includes Lang-Arg mode
|
||||||
|
|:lua| :lua execute Lua command
|
||||||
|
|:luado| :luad[o] execute Lua command for each line
|
||||||
|
|:luafile| :luaf[ile] execute Lua script file
|
||||||
|:lvimgrep| :lv[imgrep] search for pattern in files
|
|:lvimgrep| :lv[imgrep] search for pattern in files
|
||||||
|:lvimgrepadd| :lvimgrepa[dd] like :vimgrep, but append to current list
|
|:lvimgrepadd| :lvimgrepa[dd] like :vimgrep, but append to current list
|
||||||
|:lwindow| :lw[indow] open or close location window
|
|:lwindow| :lw[indow] open or close location window
|
||||||
|
|||||||
@@ -950,6 +950,7 @@ Various: *various-functions*
|
|||||||
taglist() get list of matching tags
|
taglist() get list of matching tags
|
||||||
tagfiles() get a list of tags files
|
tagfiles() get a list of tags files
|
||||||
|
|
||||||
|
luaeval() evaluate Lua expression
|
||||||
py3eval() evaluate Python expression (|+python3|)
|
py3eval() evaluate Python expression (|+python3|)
|
||||||
pyeval() evaluate Python expression (|+python|)
|
pyeval() evaluate Python expression (|+python|)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user