From 77a6c22fcace230ac6e5d239df80448ed8f3dcaa Mon Sep 17 00:00:00 2001 From: siduck Date: Sat, 3 Dec 2022 11:17:27 +0530 Subject: [PATCH] use lua api for packersync wrapper --- lua/core/init.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lua/core/init.lua b/lua/core/init.lua index 3067cc2..12bbce6 100644 --- a/lua/core/init.lua +++ b/lua/core/init.lua @@ -42,6 +42,13 @@ autocmd("FileType", { -- wrap the PackerSync command to warn people before using it in NvChadSnapshots autocmd("VimEnter", { callback = function() - vim.cmd "command! -nargs=* -complete=customlist,v:lua.require'packer'.plugin_complete PackerSync lua require('plugins') require('core.utils').packer_sync()" + 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, })