Crate nvim_utils
source ·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
requireandprint - And more to come!
Features
builderenables thebuildermodule, containingModuleBuilder(enabled by default)vimenables thevimmodule (enabled by default)asyncenables async functions inbuilder::ModuleBuilder, and theasyncfeature in mlua (disabled by default)sendenables thesendfeature formlua, which enablesSendfor lua types (disabled by default)unstableincludes unstable / untested API features (disabled by default)
Modules
- builder
builderBuilder pattern for creating lua modules in a readable, declarative way - Includes
mlua::prelude,vim,vim::ext::log, andbuilder::ModuleBuilderif the corresponding features are enabled - vim
vimSemi-direct mapping of thevimmodule in Neovim’s lua api
Functions
- Gets the global
printfunction and calls it with the given message as an argument - Gets the global
requirefunction and calls it with the given name as an argument