bundle/nvim-if-lua-compat/README.md
An if_lua compatibility layer for Neovim (WIP, needs testing)
Maintain some amount of compatibility with the existing Vim interface for Lua (see also: neovim/neovim#12537).
Items annotated with an asterisk * are only partially supported.
vim.list() (actually a Lua table, luaeval() just makes a copy and transforms it into a Vim list...)
#ll[k]l()table.insert(l, newitem)table.insert(l, position, newitem)table.remove(l, position)l:add(item)l:insert(item[, pos])vim.dict() (actually a Lua table, luaeval() just makes a copy and transforms it into a Vim dict...)
#d (Only works with Lua 5.2+ or LuaJIT built with 5.2 extensions)d.key or d['key']d()vim.blob() (actually a Lua table)
#b (Only works with Lua 5.2+ or LuaJIT built with 5.2 extensions)b[k]b:add(bytes)vim.funcref() (exists in Neovim core, but the implementation is different here)
#f (Only works with Lua 5.2+ or LuaJIT built with 5.2 extensions)f(...)vim.buffer()
b()#b (Only works with Lua 5.2+ or LuaJIT built with 5.2 extensions)b[k]b.nameb.fnameb.numberb:insert(newline[, pos])b:next()b:previous()b:isvalid()vim.window()
w()w.bufferw.line (get and set)w.col (get and set)w.width (get and set)w.height (get and set)w:next()w:previous()w:isvalid()vim.type()
listdictblobfuncrefbufferwindowvim.command() (alias to vim.api.nvim_command())vim.eval() (alias to vim.api.nvim_eval(), doesn't actually return a vim.list/dict/blob)vim.line() (alias to vim.api.nvim_get_current_line())vim.beep()vim.open()vim.call() (in Neovim core)vim.fn() (in Neovim core)