Add optional packer plugins hook
As an experiment, I've gone "neovim config bankruptcy" and have been using kickstart.nvim for the last two weeks. I added a few custom plugins to packer and several custom options and keymaps.
Then I noticed how active this repo is (which is awesome) and I wanted to upgrade my local version, but my additions were intermingled in the base init.lua file.
So, I pulled out my custom options and keymaps into a nvim/after/plugin/defaults.lua file (which worked out great), but the issue I was encountering was figuring out how to pull out the definition of my custom plugins, hence this PR.
With the two new lines included in this PR it enables the user to safely reset their version of init.lua and let any of their customizations be in a nvim/after/plugin/defaults.lua file and optionally a nvim/lua/custom/plugins.lua module.
The optional plugins module could look like...
-- lua/custom/plugins.lua
local plugins = {}
function plugins.setup(use)
use { "nvim-telescope/telescope-file-browser.nvim" }
use({
"folke/which-key.nvim",
config = function()
require("which-key").setup({})
end,
})
end
return plugins
NOTE: As an aside, it is great that you all have added the
descto the mappings you've included, which works great withwhich-key.nvimmaking it easier for a new user to get their bearings on the possible unfamiliar keymaps.
You all have done a great job of keeping things simple, fresh, and updated as neovim and plugin APIs shift. For that reason, it seems like a nice feature to let the user update their version (using something like wget https://github.com/nvim-lua/kickstart.nvim/blob/master/init.lua -O ~/.config/nvim/init.lua) without losing their custom configurations.
Thanks for your consideration.