mirror of
https://github.com/LazyVim/starter.git
synced 2026-07-25 14:01:03 +00:00
add auto update (when avaialable)
This commit is contained in:
parent
77585d70e6
commit
3da368438a
1 changed files with 13 additions and 0 deletions
|
|
@ -1,3 +1,16 @@
|
||||||
-- Autocmds are automatically loaded on the VeryLazy event
|
-- Autocmds are automatically loaded on the VeryLazy event
|
||||||
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
-- Default autocmds that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/autocmds.lua
|
||||||
-- Add any additional autocmds here
|
-- Add any additional autocmds here
|
||||||
|
local function augroup(name)
|
||||||
|
return vim.api.nvim_create_augroup("lazyvim_" .. name, { clear = true })
|
||||||
|
end
|
||||||
|
|
||||||
|
-- when available, auto update when vim starts
|
||||||
|
vim.api.nvim_create_autocmd("VimEnter", {
|
||||||
|
group = augroup("autoupdate"),
|
||||||
|
callback = function()
|
||||||
|
if require("lazy.status").has_updates then
|
||||||
|
require("lazy").update({ show = false })
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue