Expand description
§Utilities for building Neovim plugins in Rust
The intention of nvim-utils
is to allow Rust plugin authors to interact with Neovim in Rust just as easily as in Lua,
by removing as much of the required boilerplate as possible.
It provides utilities for:
- Declaratively building lua modules using
mlua
- Interacting with Neovim’s lua api
- Logging using
vim.notify
- Accessing common lua builtin functions like
require
andprint
- And more to come!
§Features
builder
enables thebuilder
module, containingModuleBuilder
(enabled by default)vim
enables thevim
module (enabled by default)async
enables async functions inbuilder::ModuleBuilder
, and theasync
feature in mlua (disabled by default)send
enables thesend
feature formlua
, which enablesSend
for lua types (disabled by default)unstable
includes unstable / untested API features (disabled by default)
Modules§
- builder
builder
- Builder pattern for creating lua modules in a readable, declarative way
- prelude
- Includes
mlua::prelude
,vim
,vim::ext::log
, andbuilder::ModuleBuilder
if the corresponding features are enabled - vim
vim
- Semi-direct mapping of the
vim
module in Neovim’s lua api
Functions§
- Gets the global
print
function and calls it with the given message as an argument - require
- Gets the global
require
function and calls it with the given name as an argument