summaryrefslogtreecommitdiff
path: root/after/plugin/gitsigns.lua
diff options
context:
space:
mode:
Diffstat (limited to 'after/plugin/gitsigns.lua')
-rw-r--r--after/plugin/gitsigns.lua17
1 files changed, 12 insertions, 5 deletions
diff --git a/after/plugin/gitsigns.lua b/after/plugin/gitsigns.lua
index b781fb6..87dd7f4 100644
--- a/after/plugin/gitsigns.lua
+++ b/after/plugin/gitsigns.lua
@@ -1,4 +1,5 @@
-require("gitsigns").setup({
+local gitsigns = require("gitsigns")
+gitsigns.setup({
signs = {
add = { text = "▎" },
change = { text = "▎" },
@@ -7,12 +8,18 @@ require("gitsigns").setup({
changedelete = { text = "▎" },
untracked = { text = "▎" },
},
+ numhl = false,
+ attach_to_untracked = true,
+ update_debounce = 0,
on_attach = function(buffer)
- local gs = package.loaded.gitsigns
local map = vim.keymap.set
-
-- stylua: ignore start
- map("n", "]g", gs.next_hunk, { desc = "Next git hunk" })
- map("n", "[g", gs.prev_hunk, { desc = "Previous git hunk" })
+ map("n", "]g", gitsigns.next_hunk, { desc = "Next git hunk" })
+ map("n", "[g", gitsigns.prev_hunk, { desc = "Previous git hunk" })
+ map("n", " gd", gitsigns.toggle_deleted, { desc="Toggle deleted"})
+ map("n", " gr", gitsigns.reset_hunk, { desc="Reset hunk"})
+ map("n", " gs", gitsigns.stage_hunk, { desc="Stage hunk"})
+ map("n", " gu", gitsigns.undo_stage_hunk, { desc="Undo stage hunk"})
+ map("n", " gb", gitsigns.blame, { desc="Blame"})
end,
})