- Add init.lua entry point - Add lua/ modules: options, keymaps, autocmds, usercmds, pack, treesitter, lsp - Add .gitignore - Add nvim-pack-lock.json for plugin version locking Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
22 lines
832 B
Lua
22 lines
832 B
Lua
vim.api.nvim_create_user_command("PackAdd", function(opts)
|
|
vim.pack.add(opts.fargs)
|
|
end, { nargs = "+", desc = "Add plugins (:PackAdd user/repo1 user/repo2)" })
|
|
|
|
-- Pack Delete and Update cmds are built-in on Nightly 0.13
|
|
vim.api.nvim_create_user_command("PackDel", function(opts)
|
|
vim.pack.del(opts.fargs)
|
|
end, { nargs = "+", desc = "Delete plugins (:PackDel plugin1 plugin2)" })
|
|
|
|
vim.api.nvim_create_user_command("PackUpdate", function(opts)
|
|
-- checks if any argument is passed
|
|
if opts.args:match("%S") then
|
|
-- update specific plugins
|
|
local plugins = vim.split(opts.args, "%s+", { trimempty = true })
|
|
-- update only specified plugins
|
|
vim.pack.update(plugins)
|
|
else
|
|
-- update all
|
|
vim.pack.update()
|
|
end
|
|
end, { nargs = "*", desc = "Update all plugins or specific ones" })
|