summaryrefslogtreecommitdiffstats
path: root/runtime/doc/if_lua.txt
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/doc/if_lua.txt')
-rw-r--r--runtime/doc/if_lua.txt15
1 files changed, 14 insertions, 1 deletions
diff --git a/runtime/doc/if_lua.txt b/runtime/doc/if_lua.txt
index cb68eefe00..f3bb0ce7a7 100644
--- a/runtime/doc/if_lua.txt
+++ b/runtime/doc/if_lua.txt
@@ -175,10 +175,17 @@ Vim evaluation and command execution, and others.
:lua print(type(l), vim.type(l))
:" list
<
- vim.command({cmd}) Executes the vim (ex-mode) command {cmd}.
+ vim.command({cmds}) Executes one or more lines of Ex-mode commands
+ in {cmds}.
Examples: >
:lua vim.command"set tw=60"
:lua vim.command"normal ddp"
+ lua << trim END
+ vim.command([[
+ new Myfile.js
+ call search('start')
+ ]])
+ END
<
vim.eval({expr}) Evaluates expression {expr} (see |expression|),
converts the result to Lua, and returns it.
@@ -211,6 +218,12 @@ Vim evaluation and command execution, and others.
vim.lua_version The Lua version Vim was compiled with, in the
form {major}.{minor}.{patch}, e.g. "5.1.4".
+ vim.version() Returns a Lua table with the Vim version.
+ The table will have the following keys:
+ major - major Vim version.
+ minor - minor Vim version.
+ patch - latest patch included.
+
*lua-vim-variables*
The Vim editor global dictionaries |g:| |w:| |b:| |t:| |v:| can be accessed
from Lua conveniently and idiomatically by referencing the `vim.*` Lua tables