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 require and print
  • And more to come!
§Features
  • builder enables the builder module, containing ModuleBuilder (enabled by default)
  • vim enables the vim module (enabled by default)
  • async enables async functions in builder::ModuleBuilder, and the async feature in mlua (disabled by default)
  • send enables the send feature for mlua, which enables Send for lua types (disabled by default)
  • unstable includes unstable / untested API features (disabled by default)

Modules§

builderbuilder
Builder pattern for creating lua modules in a readable, declarative way
prelude
Includes mlua::prelude, vim, vim::ext::log, and builder::ModuleBuilder if the corresponding features are enabled
vimvim
Semi-direct mapping of the vim module in Neovim’s lua api

Functions§

print
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

Attribute Macros§

module