Add git browser and disable lazy config auto reload

This commit is contained in:
Fábio André Damas 2025-05-05 09:47:05 +01:00
parent fde53fcdd0
commit f3155caa41
4 changed files with 43 additions and 38 deletions

View file

@ -1,24 +1,24 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" },
{ "\nPress any key to exit..." },
}, true, {})
vim.fn.getchar()
os.exit(1)
end
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup({
spec = {
{ import = "plugins" },
}
change_detection = {
enabled = false,
},
spec = {
{ import = "plugins" },
}
})

View file

@ -88,6 +88,10 @@ return {
cmd = ":lua Snacks.notifier.show_history()<CR>",
desc = "Error/notification history",
},
{
cmd = ":lua Snacks.gitbrowse()<CR>",
desc = "Show git file in the browser",
},
{
cmd = ":lua Snacks.terminal.toggle()<CR>",
desc = "Terminal",

View file

@ -15,6 +15,7 @@ return { {
}
},
git = { enabled = true },
gitbrowse = { enabled = true },
bufdelete = { enabled = true },
picker = { enabled = true }
},