diff --git a/home/.config/nvim/lua/mappings.lua b/home/.config/nvim/lua/mappings.lua index 5475017..88f2985 100644 --- a/home/.config/nvim/lua/mappings.lua +++ b/home/.config/nvim/lua/mappings.lua @@ -94,9 +94,9 @@ wk.register({ g = { name = 'Git', b = 'Blame current line', - i = 'Preview hunk', - n = 'Next hunk', - p = 'Previous hunk', + j = 'Next hunk', + k = 'Previous hunk', + p = 'Preview hunk', r = 'Reset hunk', R = 'Reset all hunks in buffer', s = 'Stage hunk', diff --git a/home/.config/nvim/lua/modules/gitgutter.lua b/home/.config/nvim/lua/modules/gitgutter.lua index 6919ab6..b250070 100644 --- a/home/.config/nvim/lua/modules/gitgutter.lua +++ b/home/.config/nvim/lua/modules/gitgutter.lua @@ -12,8 +12,8 @@ return require('gitsigns').setup { noremap = true, buffer = true, - ['n gn'] = {expr = true, '&diff ? \'gn\' : \'lua require"gitsigns.actions".next_hunk()\''}, - ['n gp'] = {expr = true, '&diff ? \'gp\' : \'lua require"gitsigns.actions".prev_hunk()\''}, + ['n gj'] = {expr = true, '&diff ? \'gj\' : \'lua require"gitsigns.actions".next_hunk()\''}, + ['n gk'] = {expr = true, '&diff ? \'gk\' : \'lua require"gitsigns.actions".prev_hunk()\''}, ['n gs'] = 'lua require"gitsigns".stage_hunk()', ['v gs'] = 'lua require"gitsigns".stage_hunk({vim.fn.line("."), vim.fn.line("v")})', @@ -21,7 +21,7 @@ return require('gitsigns').setup { ['n gr'] = 'lua require"gitsigns".reset_hunk()', ['v gr'] = 'lua require"gitsigns".reset_hunk({vim.fn.line("."), vim.fn.line("v")})', ['n gR'] = 'lua require"gitsigns".reset_buffer()', - ['n gi'] = 'lua require"gitsigns".preview_hunk()', + ['n gp'] = 'lua require"gitsigns".preview_hunk()', ['n gb'] = 'lua require"gitsigns".blame_line(true)' }, watch_index = { diff --git a/home/.config/nvim/lua/plugins.lua b/home/.config/nvim/lua/plugins.lua index a884710..c242ebf 100644 --- a/home/.config/nvim/lua/plugins.lua +++ b/home/.config/nvim/lua/plugins.lua @@ -60,6 +60,7 @@ return packer.startup( use { 'lewis6991/gitsigns.nvim', requires = 'nvim-lua/plenary.nvim', + event = {'BufRead', 'BufNewFile'}, config = function() require('modules.gitgutter') end @@ -76,6 +77,7 @@ return packer.startup( } use { 'lukas-reineke/indent-blankline.nvim', + event = 'BufRead', config = function() require('modules.blankline') end @@ -112,7 +114,7 @@ return packer.startup( -- Editing use { 'terrortylor/nvim-comment', - cmd = 'CommentToggle', + after = 'nvim-treesitter', config = function() require('nvim_comment').setup() end