summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Vanbesien <tvanbesi@proton.me>2026-05-21 16:16:23 +0200
committerThomas Vanbesien <tvanbesi@proton.me>2026-05-21 16:16:23 +0200
commit2bdcbb46504b40cf8a205768c6ac5975c771b39c (patch)
tree37d29411ac9801944d8ebf195a4883448440d0da
parentb413d9c470f3597be1a51b52e58c854db5f31bd2 (diff)
downloaddotfiles-2bdcbb46504b40cf8a205768c6ac5975c771b39c.tar.gz
dotfiles-2bdcbb46504b40cf8a205768c6ac5975c771b39c.zip
misc(nvim): add keymaps for GitGutter functions
-rw-r--r--.config/nvim/plugin/50-git.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/.config/nvim/plugin/50-git.lua b/.config/nvim/plugin/50-git.lua
index ee5da46..8a8a634 100644
--- a/.config/nvim/plugin/50-git.lua
+++ b/.config/nvim/plugin/50-git.lua
@@ -4,6 +4,13 @@
vim.pack.add({ "https://github.com/airblade/vim-gitgutter" }) -- Show git status in the gutter
+vim.opt.updatetime = 100 -- How often the git signs in the gutter update in ms
+
+vim.keymap.set("n", "<Leader>gt", "<Cmd>GitGutterLineHighlightsToggle<CR>", { desc = "Toggle git line highlighting" })
+vim.keymap.set("n", "<Leader>gg", "<Cmd>GitGutter<CR>", { desc = "Refresh GitGutter" })
+vim.keymap.set("n", "<Leader>gq", "<Cmd>GitGutterQuickFix<CR>", { desc = "Git hunks to quickfix list" })
+vim.keymap.set("n", "<Leader>gz", "<Cmd>GitGutterFold<CR>", { desc = "Fold everything except git diff" })
+
local function git_blame(file, line)
local sys = vim.system({
"bash",