RPM is a rudimentary plugin manager for NeoVim. It is designed to be simple and easy to use.
- Clone the repository into your
~/.config/nvim/pack/plugins/start
directory:
git clone https://github.com/nizamiza/rpm.git ~/.config/nvim/pack/plugins/start/rpm
- Create
rpm.lua
in your~/.config/nvim/lua/plugins/
directory:
-- lua/plugins/rpm.lua
return {
"nizamiza/rpm",
}
This is required so that RPM doesn't remove itself when you run
:Rpm clean
.
- Require the plugin in your
init.lua
:
require("rpm")
- Restart NeoVim!
-
Define your plugins in
lua/plugins/
directory of your NeoVim configuration directory. The file should correspond to the plugin name. Avoid any extra extensions in the file name (.vim
,.nvim
, etc). For example, if you want to installnvim-telescope/telescope.nvim
, you would create a file calledtelescope.lua
in thelua/plugins/
directory:-- lua/plugins/telescope.lua return { "nvim-telescope/telescope.nvim", function() require("telescope").setup({ defaults = { layout_strategy = "vertical", }, }) end }
The first element in the table is the plugin name. Either specify a full URL to the repository or a shorthand name if it is available on GitHub.
The second element is an optional function that will be called after the plugin is loaded. This is useful for calling the setup function for the plugin, setting up keybindings, etc.
Restart NeoVim after adding or modifying a plugin definition.
-
Telescope has a dependency on
plenary.nvim
. To define a plugin dependency, you can pass a table as the first element in the plugin definition. Make sure that the main plugin is the last element in the table. For example:-- lua/plugins/telescope.lua return { { "nvim-lua/plenary.nvim", "nvim-telescope/telescope.nvim", }, function() require("telescope").setup({ defaults = { layout_strategy = "vertical", }, }) end }
You can use this to define dependencies or just to group plugins together. But remember that only the last plugin is treated as the "main" plugin. Others will not show up when you run
:Rpm list
. -
Run
:Rpm install <plugin-name>
to install a plugin and its dependencies. This will clone the repositories into the~/.config/nvim/pack/plugins/start/
directory and then run the setup function for each plugin. -
Alternatively, run
:Rpm install_all
to install all plugins in thelua/plugins/
directory. -
Run
:Rpm generate_helptags
to generate helptags for a plugin. By default, RPM runs the help tag generation command for each plugin after it is installed. You can run this command manually if you need to regenerate the helptags. -
Run
:Rpm list
to see a list of installed plugins. -
Run
:Rpm update
to update a specific plugin. -
Run
:Rpm update_all
to update all plugins. -
Run
:Rpm clean
to remove all plugins that are not defined in thelua/plugins/
directory. -
Run
:Rpm delete
to remove a specific plugin. -
Run
:Rpm delete_all
to remove all plugins.
You can run :Run help
to see a list of available commands.
RPM is indeed a rudimentary plugin manager. It is not designed to be a
full-featured plugin manager like vim-plug
or packer.nvim
. If you seek more
advanced features, consider alternatives.
This project is licensed under the Apache License, Version 2.0. See LICENSE for more information.