mirror of
https://github.com/neovim/neovim.git
synced 2025-12-10 00:22:41 +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
|
||||
log({expr}) Float natural logarithm (base e) of {expr}
|
||||
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}
|
||||
maparg({name}[, {mode} [, {abbr} [, {dict}]]])
|
||||
String or Dict
|
||||
@@ -5095,6 +5096,9 @@ log10({expr}) *log10()*
|
||||
:echo log10(0.01)
|
||||
< -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()*
|
||||
{expr1} must be a |List| or a |Dictionary|.
|
||||
|
||||
@@ -114,8 +114,9 @@ functions may be found in |api-funcs.txt|.
|
||||
*luaeval()*
|
||||
|
||||
The (dual) equivalent of "vim.eval" for passing Lua values to Vim is
|
||||
"luaeval". "luaeval" takes an expression string and an optional argument and
|
||||
returns the result of the expression. It is semantically equivalent in Lua to:
|
||||
"luaeval". "luaeval" takes an expression string and an optional argument used
|
||||
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 "
|
||||
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
|
||||
impossible to determine whether empty table is meant to be empty list or empty
|
||||
dictionary. To distinguish between these cases there is the following
|
||||
agreement:
|
||||
dictionary. Additionally lua does not have integer numbers. To distinguish
|
||||
between these cases there is the following agreement:
|
||||
|
||||
0. Empty table is empty list.
|
||||
1. Table with N incrementally growing integral numbers, starting from 1 and
|
||||
@@ -165,9 +166,9 @@ Examples: >
|
||||
:echo Rand(1,10)
|
||||
|
||||
Note that currently second argument to `luaeval` undergoes VimL to lua
|
||||
conversion, so changing resulting containers in lua do not affect values in
|
||||
VimL. Return value is also always converted. When converting,
|
||||
|msgpack-special-dict|s are treated specially.
|
||||
conversion, so changing containers in lua do not affect values in VimL. Return
|
||||
value is also always converted. When converting, |msgpack-special-dict|s are
|
||||
treated specially.
|
||||
|
||||
==============================================================================
|
||||
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
|
||||
location list
|
||||
|: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
|
||||
|:lvimgrepadd| :lvimgrepa[dd] like :vimgrep, but append to current list
|
||||
|:lwindow| :lw[indow] open or close location window
|
||||
|
||||
@@ -950,6 +950,7 @@ Various: *various-functions*
|
||||
taglist() get list of matching tags
|
||||
tagfiles() get a list of tags files
|
||||
|
||||
luaeval() evaluate Lua expression
|
||||
py3eval() evaluate Python expression (|+python3|)
|
||||
pyeval() evaluate Python expression (|+python|)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user