{ ... }: { youthlic.plugins.gitsigns = { enable = true; luaConfig.post = #lua '' _M.on_load("snacks", function() vim.schedule(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("uG") end) end) ''; settings = { current_line_blame = true; signcolumn = true; numhl = true; linehl = false; signs = { add = { text = "┃"; }; change = { text = "┃"; }; delete = { text = ""; }; topdelete = { text = ""; }; changedelete = { text = "┃"; }; untracked = { text = "┃"; }; }; signs_staged = { add = { text = "┃"; }; change = { text = "┃"; }; delete = { text = ""; }; topdelete = { text = ""; }; changedelete = { text = "┃"; }; }; on_attach = { __raw = #lua '' function(buffer) local gs = package.loaded.gitsigns local map = function(mode, l, r, desc) vim.keymap.set(mode, l, r, { buffer = buffer, desc = desc, }) end map("n", "]h", function() if vim.wo.diff then vim.cmd.normal({ "]c", bang = true }) else gs.nav_hunk("next") end end, "Next Hunk") map("n", "[h", function() if vim.wo.diff then vim.cmd.normal({ "[c", bang = true }) else gs.nav_hunk("prev") end end, "Prev Hunk") map("n", "]H", function() gs.nav_hunk("last") end, "Last Hunk") map("n", "[H", function() gs.nav_hunk("first") end, "First Hunk") map({ "n", "v" }, "ghs", ":Gitsigns stage_hunk", "Stage Hunk") map({ "n", "v" }, "ghr", ":Gitsigns reset_hunk", "Reset Hunk") map("n", "ghS", gs.stage_buffer, "Stage Buffer") map("n", "ghu", gs.undo_stage_hunk, "Undo Stage Hunk") map("n", "ghR", gs.reset_buffer, "Reset Buffer") map("n", "ghp", gs.preview_hunk_inline, "Preview Hunk Inline") map("n", "ghb", function() gs.blame_line({ full = true }) end, "Blame Line") map("n", "ghB", function() gs.blame() end, "Blame Buffer") map("n", "ghd", gs.diffthis, "Diff This") map("n", "ghD", function() gs.diffthis("~") end, "Diff This ~") map({ "o", "x" }, "ih", ":Gitsigns select_hunk", "GitSigns Select Hunk") end ''; }; }; }; }