Reload packer.lua if any of the sub configs change
This commit is contained in:
parent
aa2c108f5a
commit
0312cd06ae
@ -271,13 +271,15 @@ end
|
|||||||
|
|
||||||
|
|
||||||
-- Automatically reload packer configuration on write
|
-- Automatically reload packer configuration on write
|
||||||
vim.cmd([[
|
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||||
augroup packer_user_config
|
group = vim.api.nvim_create_augroup("PackerUserConfig", { clear = true }),
|
||||||
autocmd!
|
pattern = { "packer.lua", vim.fn.stdpath("config") .. "/lua/valeth/packer/*.lua" },
|
||||||
autocmd BufWritePost packer.lua source <afile> | PackerCompile
|
callback = function(_)
|
||||||
augroup end
|
local source_file = vim.fn.stdpath("config") .. "/lua/valeth/packer.lua"
|
||||||
]])
|
vim.cmd("source " .. source_file)
|
||||||
|
require("packer").compile()
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
return require("packer").startup {
|
return require("packer").startup {
|
||||||
spec,
|
spec,
|
||||||
|
Loading…
Reference in New Issue
Block a user