Description
I propose that this code snippet be added to the Tips page on the wiki:
-- Run PlugInstall if there are missing plugins
vim.api.nvim_create_autocmd("VimEnter", {
callback = function()
local plugs = vim.g.plugs or {}
for _, plug in pairs(plugs) do
if vim.fn.isdirectory(plug.dir) == 0 then
vim.cmd("PlugInstall --sync")
vim.cmd("source $MYVIMRC")
break
end
end
end,
})
Note: the code was generated by ChatGPT (https://chatgpt.com/s/t_6a51a66c67fc8191a0037a87aa6e7ad3) and tested by me.
Plug block
:version
NVIM v0.12.2
Build type: RelWithDebInfo
LuaJIT 2.1.1774896198
Type
OS
Vim
Description
I propose that this code snippet be added to the Tips page on the wiki:
Note: the code was generated by ChatGPT (https://chatgpt.com/s/t_6a51a66c67fc8191a0037a87aa6e7ad3) and tested by me.
Plug block
:version
Type
OS
Vim