Function lua

Source
pub fn lua() -> Lua
Available on crate feature mlua only.
Expand description

Returns a mlua::Lua instance which can be used to interact with Lua plugins.

§Examples

use mlua::prelude::LuaFunction;
use nvim_oxi as nvim;

#[nvim::plugin]
fn mlua() -> nvim::Result<()> {
    nvim::print!("Hello from nvim-oxi..");

    let lua = nvim::mlua::lua();
    let print = lua.globals().get::<_, LuaFunction>("print")?;
    print.call("..and goodbye from mlua!")?;

    Ok(())
}