nanotee / nvim-if-lua-compat

An if_lua compatibility layer for Neovim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nvim-if-lua-compat

An if_lua compatibility layer for Neovim (WIP, needs testing)

Goals

Maintain some amount of compatibility with the existing Vim interface for Lua (see also: neovim/neovim#12537).

Progress

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...)
    • #l
    • l[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.name
    • b.fname
    • b.number
    • b:insert(newline[, pos])
    • b:next()
    • b:previous()
    • b:isvalid()
  • vim.window()
    • w()
    • w.buffer
    • w.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()
    • list
    • dict
    • blob
    • funcref
    • buffer
    • window
  • vim.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)

About

An if_lua compatibility layer for Neovim


Languages

Language:Lua 100.0%