port packer autocmd to lua

pull/198/head
REmerald 2 years ago committed by GitHub
parent 9a928f56a1
commit 23778b1f65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,12 +16,12 @@ if fn.empty(fn.glob(install_path)) > 0 then
end end
-- Autocommand that reloads neovim whenever you save the plugins.lua file -- Autocommand that reloads neovim whenever you save the plugins.lua file
vim.cmd([[ local au_packer = vim.api.nvim_create_augroup("packer_autoconf", {clear = true})
augroup packer_user_config vim.api.nvim_create_autocmd(
autocmd! "BufWritePost", {group = au_packer, pattern = "plugins.lua",
autocmd BufWritePost plugins.lua source <afile> | PackerSync command = "source <afile> <Bar> PackerSync",
augroup end desc = "Reloads nvim when you save plugins.lua"}
]]) )
-- Use a protected call so we don't error out on first use -- Use a protected call so we don't error out on first use
local status_ok, packer = pcall(require, "packer") local status_ok, packer = pcall(require, "packer")

Loading…
Cancel
Save