return { "lewis6991/gitsigns.nvim", opts = { signs = { add = { text = "│" }, change = { text = "│" }, delete = { text = "_" }, topdelete = { text = "‾" }, changedelete = { text = "~" }, untracked = { text = "┆" }, }, auto_attach = true, signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` numhl = false, -- Toggle with `:Gitsigns toggle_numhl` linehl = false, -- Toggle with `:Gitsigns toggle_linehl` word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` watch_gitdir = { interval = 1000, follow_files = true, }, attach_to_untracked = true, current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` current_line_blame_opts = { virt_text = true, virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' delay = 1000, ignore_whitespace = false, }, current_line_blame_formatter = ", - ", sign_priority = 6, update_debounce = 100, status_formatter = nil, -- Use default max_file_length = 40000, -- Disable if file is longer than this (in lines) preview_config = { -- Options passed to nvim_open_win border = "single", style = "minimal", relative = "cursor", row = 0, col = 1, } }, keys = { { "]c", function() if vim.wo.diff then vim.cmd.normal({ "]c", bang = true }) else require("gitsigns").nav_hunk("next") end end, desc = "Next hunk", }, { "[c", function() if vim.wo.diff then vim.cmd.normal({ "[c", bang = true }) else require("gitsigns").nav_hunk("prev") end end, desc = "Previous hunk", }, { "hs", function() require("gitsigns").stage_hunk() end, desc = "Stage hunk", }, { "hr", function() require("gitsigns").reset_hunk() end, desc = "Reset hunk", }, { "hp", function() require("gitsigns").preview_hunk() end, desc = "Preview hunk", }, { "hi", function() require("gitsigns").preview_hunk_inline() end, desc = "Preview hunk inline", }, { "hb", [[:lua require('gitsigns').blame_line{full=true}]], desc = "Blame line", }, { "hd", [[:lua require('gitsigns').diffthis()]], desc = "Diff this", }, { "tb", function() require("gitsigns").toggle_current_line_blame() end, desc = "Toggle line blame", }, { "ih", [[:lua require('gitsigns').select_hunk()]], mode = { "o", "x" }, desc = "Select hunk", }, }, }