From 66001689a5456438aae265e903f2bea182815f18 Mon Sep 17 00:00:00 2001 From: Andy Teijelo Date: Thu, 3 Nov 2022 11:10:51 -0400 Subject: [PATCH] gitsigns keymaps --- lua/user/gitsigns.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/user/gitsigns.lua b/lua/user/gitsigns.lua index 9453e4f..2278544 100644 --- a/lua/user/gitsigns.lua +++ b/lua/user/gitsigns.lua @@ -33,4 +33,11 @@ gitsigns.setup { row = 0, col = 1, }, + on_attach = function (bufnr) + local gs = package.loaded.gitsigns + local opts = { buffer=bufnr, silent=true } + vim.keymap.set('n', 'hp', gs.preview_hunk, opts) + vim.keymap.set('n', 'hb', function() gs.blame_line{full=false} end, opts) + vim.keymap.set('n', 'hB', function() gs.blame_line{full=true} end, opts) + end }