use lua api for packersync wrapper

This commit is contained in:
siduck 2022-12-03 11:17:27 +05:30
parent 8db69224ba
commit 77a6c22fca
1 changed files with 8 additions and 1 deletions

View File

@ -42,6 +42,13 @@ autocmd("FileType", {
-- wrap the PackerSync command to warn people before using it in NvChadSnapshots -- wrap the PackerSync command to warn people before using it in NvChadSnapshots
autocmd("VimEnter", { autocmd("VimEnter", {
callback = function() callback = function()
vim.cmd "command! -nargs=* -complete=customlist,v:lua.require'packer'.plugin_complete PackerSync lua require('plugins') require('core.utils').packer_sync(<f-args>)" vim.api.nvim_create_user_command("PackerSync", function(opts)
require "plugins"
require("core.utils").packer_sync(opts.fargs)
end, {
bang = true,
nargs = "*",
complete = require("packer").plugin_complete,
})
end, end,
}) })