diff --git a/nvim/.config/nvim/lua/modules/gitsigns.lua b/nvim/.config/nvim/lua/modules/gitsigns.lua index dcacec4..0034e24 100644 --- a/nvim/.config/nvim/lua/modules/gitsigns.lua +++ b/nvim/.config/nvim/lua/modules/gitsigns.lua @@ -7,13 +7,18 @@ require('gitsigns').setup { changedelete = {hl = 'DiffChange', text = '~'}, }, keymaps = { - [']c'] = 'lua require("gitsigns").next_hunk()', - ['[c'] = 'lua require("gitsigns").prev_hunk()', - ['ghs'] = 'lua require("gitsigns").stage_hunk()', - ['ghu'] = 'lua require("gitsigns").undo_stage_hunk()', - ['ghr'] = 'lua require("gitsigns").reset_hunk()', + noremap = true, + buffer = true, + + ['n ]c'] = { expr = true, "&diff ? ']c' : 'lua require\"gitsigns\".next_hunk()'"}, + ['n [c'] = { expr = true, "&diff ? '[c' : 'lua require\"gitsigns\".prev_hunk()'"}, + + ['n ghs'] = 'lua require"gitsigns".stage_hunk()', + ['n ghu'] = 'lua require"gitsigns".undo_stage_hunk()', + ['n ghr'] = 'lua require"gitsigns".reset_hunk()', }, watch_index = { interval = 1000 - } + }, + sign_priority = 6, }