From 529898343aed91872813833b1fa6bdf688cc4b2e Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Thu, 12 Feb 2026 18:21:04 +0300 Subject: 12.02.2026 --- config/nvim/lua/plugins/gitsigns.lua | 118 +++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 config/nvim/lua/plugins/gitsigns.lua (limited to 'config/nvim/lua/plugins/gitsigns.lua') diff --git a/config/nvim/lua/plugins/gitsigns.lua b/config/nvim/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..5994cc8 --- /dev/null +++ b/config/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,118 @@ +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", + }, + }, +} \ No newline at end of file -- cgit v1.2.3