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

Functions

  • Gets the global print function and calls it with the given message as an argument
  • Gets the global require function and calls it with the given name as an argument

Attribute Macros