chore(nvim): switch lewis6991/gitsigns.nvim

main
sudo pacman -Syu 2023-06-23 10:58:51 +07:00
parent 0d4b7c90f6
commit c2f57b2b18
1 changed files with 38 additions and 2 deletions

View File

@ -165,8 +165,44 @@ require("lazy").setup({
end,
},
-- https://github.com/airblade/vim-gitgutter
"airblade/vim-gitgutter",
-- https://github.com/lewis6991/gitsigns.nvim
{
"lewis6991/gitsigns.nvim",
config = function()
require("gitsigns").setup({
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map("n", "]c", function()
if vim.wo.diff then
return "]c"
end
vim.schedule(function()
gs.next_hunk()
end)
return "<Ignore>"
end, { expr = true })
map("n", "[c", function()
if vim.wo.diff then
return "[c"
end
vim.schedule(function()
gs.prev_hunk()
end)
return "<Ignore>"
end, { expr = true })
end,
})
end,
},
-- https://github.com/echasnovski/mini.nvim
{