1. Adding the plugin
The first step to install a plugin to your Better Vim config is add it to the plugins list.lazy.nvim uses Github to install and
manage plugins. For example, if we want to install the todo-comments plugin we can change the entry plugins in better-vim.lua:
better-vim.lua
username/repository to the plugin manager.
Usually, the installation instructions of the plugin show how to install the plugin using lazy.nvim and other package managers. If lazy.nvim is not present, the installation via Packer is pretty simmilar, with some differences that you can see here.
If the plugin has some dependencies, you can use the dependencies entry in the plugin table:
better-vim.lua
2. Setting up the plugin
Some plugins (like todo-comments) requires a setup or an initial config to work. You can do this using the entryconfig in the plugin table:
better-vim.lua
.setup method is a common way to configure plugins in Vim from Lua. If .setup is the only function you need to call to setup your plugin, and/or pass some properties to it, instead of creating a new function, requiring the plugin and calling the .setup method, you can just use the entry opts instead:
better-vim.lua
Sometimes you need to execute raw Vim commands to setup the plugin.
You can use vim.cmd [[ VIM_COMMAND_HERE ]] to run Vim commands inside of a
You can use vim.cmd [[ VIM_COMMAND_HERE ]] to run Vim commands inside of a
.lua file.:Lazy π
To see every possible option, check out the lazy.nvim documentation page.
Updating plugins
To update all your plugins, just run::Lazy interface and press Shift + S.
Uninstalling plugins
If you want to uninstall any plugin, remove the plugin from theplugins entry in better-vim.lua, reopen neovim and run this command inside Neovim:
:Lazy to open Lazy interface, then press Shift + X, or just type :Lazy clean.