From b8818d5439eebe9ba6cac5d08a9a2f07d283e2a2 Mon Sep 17 00:00:00 2001 From: Marko Korhonen Date: Mon, 21 Aug 2023 15:26:33 +0300 Subject: [PATCH] Nvim: add keybinds to move to next/prev hunk --- home/.config/nvim/lua/plugins/which-key.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/home/.config/nvim/lua/plugins/which-key.lua b/home/.config/nvim/lua/plugins/which-key.lua index 0d4bfe6b..62ad276c 100644 --- a/home/.config/nvim/lua/plugins/which-key.lua +++ b/home/.config/nvim/lua/plugins/which-key.lua @@ -1,5 +1,6 @@ return function() local wk = require("which-key") + local gitsigns = require("gitsigns") wk.setup({}) wk.register({ @@ -10,6 +11,8 @@ return function() wk.register({ [""] = { "bnext", "Next buffer" }, [""] = { "bprevious", "Previous buffer" }, + ["["] = { h = { gitsigns.prev_hunk, "Previous hunk" } }, + ["]"] = { h = { gitsigns.next_hunk, "Next hunk" } }, }) -- Exit terminal insert mode with esc