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 }