mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-21 16:39:06 +02:00
feat(git): added toggles for gitsigns.nvim and mini.diff
This commit is contained in:
parent
d424a02554
commit
2ebba15e12
2 changed files with 37 additions and 0 deletions
|
@ -300,6 +300,20 @@ return {
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"gitsigns.nvim",
|
||||||
|
opts = function()
|
||||||
|
Snacks.toggle({
|
||||||
|
name = "Git Signs",
|
||||||
|
get = function()
|
||||||
|
return require("gitsigns.config").config.signcolumn
|
||||||
|
end,
|
||||||
|
set = function(state)
|
||||||
|
require("gitsigns").toggle_signs(state)
|
||||||
|
end,
|
||||||
|
}):map("<leader>uG")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
-- better diagnostics list and others
|
-- better diagnostics list and others
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,6 +29,29 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"mini.diff",
|
||||||
|
opts = function()
|
||||||
|
Snacks.toggle({
|
||||||
|
name = "Mini Diff Signs",
|
||||||
|
get = function()
|
||||||
|
return vim.b.minidiff_disable ~= true
|
||||||
|
end,
|
||||||
|
set = function(state)
|
||||||
|
vim.b.minidiff_disable = not state
|
||||||
|
if state then
|
||||||
|
require("mini.diff").enable(0)
|
||||||
|
else
|
||||||
|
require("mini.diff").disable(0)
|
||||||
|
end
|
||||||
|
-- HACK: redraw to update the signs
|
||||||
|
vim.defer_fn(function()
|
||||||
|
vim.cmd([[redraw!]])
|
||||||
|
end, 200)
|
||||||
|
end,
|
||||||
|
}):map("<leader>uG")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
-- lualine integration
|
-- lualine integration
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue