Closes #6705
This commit is contained in:
Justin M. Keyes
2017-05-11 17:45:11 +02:00
committed by GitHub
parent f57149d2f4
commit edfe0980f1
2 changed files with 16 additions and 21 deletions

View File

@@ -1,21 +1,19 @@
*if_lua.txt* For Neovim *if_lua.txt* Nvim
VIM REFERENCE MANUAL by Luis Carvalho VIM REFERENCE MANUAL by Luis Carvalho
The Lua Interface to Vim *lua* *Lua* Lua Interface to Nvim *lua* *Lua*
1. Commands |lua-commands| Type <M-]> to see the table of contents.
2. The vim module |lua-vim|
3. The luaeval function |lua-luaeval|
============================================================================== ==============================================================================
1. Commands *lua-commands* 1. Commands *lua-commands*
*:lua* *:lua*
:[range]lua {chunk} :[range]lua {chunk}
Execute Lua chunk {chunk}. {not in Vi} Execute Lua chunk {chunk}.
Examples: Examples:
> >
@@ -25,7 +23,7 @@ Examples:
:[range]lua << {endmarker} :[range]lua << {endmarker}
{script} {script}
{endmarker} {endmarker}
Execute Lua script {script}. {not in Vi} Execute Lua script {script}.
Note: This command doesn't work when the Lua Note: This command doesn't work when the Lua
feature wasn't compiled in. To avoid errors, see feature wasn't compiled in. To avoid errors, see
|script-here|. |script-here|.
@@ -48,8 +46,8 @@ Example:
EOF EOF
endfunction endfunction
Note that in example variables are prefixed with local: they will disappear Note that the variables are prefixed with `local`: they will disappear when
when block finishes. This is not the case for globals. block finishes. This is not the case for globals.
To see what version of Lua you have: > To see what version of Lua you have: >
:lua print(_VERSION) :lua print(_VERSION)
@@ -66,7 +64,6 @@ If you use LuaJIT you can also use this: >
If the value returned by the function is a string it If the value returned by the function is a string it
becomes the text of the line in the current turn. The becomes the text of the line in the current turn. The
default for [range] is the whole file: "1,$". default for [range] is the whole file: "1,$".
{not in Vi}
Examples: Examples:
> >
@@ -80,7 +77,7 @@ Examples:
*:luafile* *:luafile*
:[range]luafile {file} :[range]luafile {file}
Execute Lua script in {file}. {not in Vi} Execute Lua script in {file}.
The whole argument is used as a single file name. The whole argument is used as a single file name.
Examples: Examples:
@@ -107,7 +104,7 @@ position are restricted when the command is executed in the |sandbox|.
Lua interfaces Vim through the "vim" module. Currently it only has `api` Lua interfaces Vim through the "vim" module. Currently it only has `api`
submodule which is a table with all API functions. Descriptions of these submodule which is a table with all API functions. Descriptions of these
functions may be found in |api-funcs.txt|. functions may be found in |api.txt|.
============================================================================== ==============================================================================
3. The luaeval function *lua-luaeval* *lua-eval* 3. The luaeval function *lua-luaeval* *lua-eval*

View File

@@ -241,21 +241,19 @@ Lua interface (|if_lua.txt|):
- `:lua error('TEST')` will print “TEST” as the error in Vim and “E5105: Error - `:lua error('TEST')` will print “TEST” as the error in Vim and “E5105: Error
while calling lua chunk: [string "<VimL compiled string>"]:1: TEST” in while calling lua chunk: [string "<VimL compiled string>"]:1: TEST” in
Neovim. Neovim.
- Lua has direct access to Neovim api via `vim.api`. - Lua has direct access to Nvim |API| via `vim.api`.
- Currently most of features are missing. - Currently, most legacy Vim features are missing.
============================================================================== ==============================================================================
5. Missing legacy features *nvim-features-missing* 5. Missing legacy features *nvim-features-missing*
*if_lua* *if_perl* *if_mzscheme* *if_tcl*
These legacy Vim features may be implemented in the future, but they are not Some legacy Vim features are not implemented:
planned for the current milestone.
- |if_py|: vim.bindeval() and vim.Function() are not supported - |if_py|: vim.bindeval() and vim.Function() are not supported
- |if_lua| - |if_lua|: the `vim` object currently only supports `vim.api`
- |if_perl| - *if_perl*
- |if_mzscheme| - *if_mzscheme*
- |if_tcl| - *if_tcl*
============================================================================== ==============================================================================
6. Removed features *nvim-features-removed* 6. Removed features *nvim-features-removed*