Add Lua version of the script to autoinstall missing plugins
- Dominant language
- Vim Script
- Stars
- 35.8k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
### Description
I propose that this code snippet be added to the Tips page on the wiki:
```lua
-- 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
```vim
```
### :version
```text
NVIM v0.12.2
Build type: RelWithDebInfo
LuaJIT 2.1.1774896198
```
### Type
- [ ] Bug
- [x] Enhancement
- [ ] Feature Request
- [ ] Question
### OS
- [ ] All/Other
- [x] Linux
- [ ] macOS
- [ ] Windows
### Vim
- [ ] Terminal Vim
- [ ] GVim
- [x] Neovim
Contributor guide
No contributing guide indexed for this repository
Research direction
Open the vim-plug wiki and locate the Tips page referenced in the issue. Review the existing autoinstall guidance and add the proposed Lua snippet alongside it. Done means the Lua version appears clearly on the Tips page and its formatting and links render correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, vim
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 75/100