A light Neovim package manager. :package: :swan:
This repository contains the Lua source code for an extremely light package manager for Neovim. The package manager is named after the Chinese goddess of creation, Nuwa (女媧).
NuwaDelete command.I use Nuwa to manage the plugins in my own configuration. This configuration
can be found here: alyxshang/alyx.nvim
Nuwa requires the git command to be available from
the command line. To install Nuwa, add these lines to
your init.lua, the Lua configuration file for Neovim. It is
strongly recommended to wrap this snippet into a function and call
this function before installing a package. The code in this snippet
will download this repository, place it into Neovim's data directory,
and add the path of the repository to Neovim's runtime path.
local nuwaPath = vim.fn.stdpath("data") .. "/nuwa"
vim.fn.system(
{
"git",
"clone",
"--depth=1",
"https://github.com/alyxshang/nuwa.nvim.git",
nuwaPath
}
)
vim.opt.rtp:prepend(nuwaPath)
The code snippet below illustrates how to load Nuwa itself, install a package, and load the package. The section below this code snippet explains usage of Nuwa further.
-- Declare the "nuwa" module.
local nuwa = require("nuwa")
-- Run the "nuwa" setup
-- function.
nuwa.setup()
-- Install a package.
nuwa.installPackage(
"https://github.com",
"alyxshang",
"emeraldsparrow.nvim"
)
-- Require the installed package
-- and start using it.
require("emeraldsparrow").setup(
{
transparent = false
}
)
To install a package, you must always load Nuwa itself and use the returned instance of Nuwa.
installPackage function on a loaded instance of Nuwa. This function expects three arguments: i) the Git hosting provider, ii) the owner of the Git repository containing the package, and iii) the name of the Git repository. This enables users of Neovim and Nuwa to install packages from any platform hosting Git repositories. To load a package saved locally on disk, call the installLocal function on a loaded Nuwa instance supplying the absolute path of the package as an argument.NuwaDelete command. This command expects the name of a package as an argument. This command is only for packages installed from a remote Git repository.setup function is called on a loaded instance of Nuwa.nuwaPkgs directory inside Neovim's data directory. nuwa directory inside Neovim's data directory.