installer.nvim
is a plugin that allows you to install external dependencies from neovim.
- Many builtin installers.
- Most of builtin installers support windows.
- Able to create custom installers.
- Configurable.
You can find the built-in modules here
This plugin requires plenary.nvim
.
With packer.nvim
use { "nazo6/installer.nvim",
requires = {"nvim-lua/plenary.nvim"}
}
You can install module using :Install <category> <name>
and uninstall using :Uninstall <category> <name>
.
You can also use :Update
to update modules at once.
This plugin does not make much sense on its own. It is more powerful when used in combination with various plugins using the integrations.
There is a setup
function. This plugin works even if you don't call it, but if you do, call it before any other integration.
This is example of config.
require("installer").setup({
-- Automatically installs modules that are not installed at startup
ensure_installed = {
tools = {"ripgrep"}
}
-- User defined modules(installers). See the "Custom module" section below for more information.
custom_modules = {
},
-- Hooks
hooks = {
install = {
pre = {
function (category, name)
end
}
}
}
debug = false,
})
require("installer.integrations.null_ls").setup {
configs = {
debug = true,
capabilities = {},
on_attach = {},
},
enable_hook = true,
}
Modules belonging to the tools
category have information about the own path, which can be retrieved with the following code.
require("installer.integrations.tools").get "ripgrep",
ensure_installed
if you want to be sure that it is installed.
This will make any external dependencies of the plugin portable.
This is an example of the configuration in telescope.nvim
.
require("telescope").setup {
defaults = {
vimgrep_arguments = {
require("installer.integrations.tools").get "ripgrep",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case",
},
},
}
:Install <category> <name>
: Install module. For example::Install null_ls stylua
:Reinstall <category> <name>
: Reinstall module.:Uninstall <category> <name>
: Uninstall module.:Update [<category> <name>]
: Update module. If args are omitted, all plugins will be updated.
setup(config)
Set config and install modules specified byensure_installed
register(category, name, module)
install(category, name)
uninstall(category, name)
reinstall(category, name)
module_path(category, name)
Get installation path of module. This function returns the path regardless of whether the module is actually installed or not.
get_module(category, name)
Get module content
get_modules()
Get all module name tableget_categories()
Get all categories nameget_category_modules(category)
Get all modules of category
setup(opts)
get(module_name)
get_all()
get(module_name)
get_all()
You can create custom modules and register it by setup
or register
function.
All modules must have install_script
field, which is function that return install script. You should determine the os in your function and return the appropriate script for it.
On Windows, the script will run in powershell.exe
, otherwise it will run in /bin/bash
.
- nvim-lspinstall and This PR - Base of this plugin.
- packer.nvim - Very helpful about the displaying.
- plenary.nvim