diff --git a/nvim/.config/nvim/lua/init.lua b/nvim/.config/nvim/lua/init.lua index 28204e0..a2b85c4 100644 --- a/nvim/.config/nvim/lua/init.lua +++ b/nvim/.config/nvim/lua/init.lua @@ -113,6 +113,7 @@ require 'modules.diagnostic' require 'modules.floaterm' require 'modules.fzf' require 'modules.fzf-preview' +require 'modules.gitsigns' require 'modules.sneak' require 'modules.togglelist' require 'modules.which_key' diff --git a/nvim/.config/nvim/lua/modules/gitsigns.lua b/nvim/.config/nvim/lua/modules/gitsigns.lua new file mode 100644 index 0000000..dcacec4 --- /dev/null +++ b/nvim/.config/nvim/lua/modules/gitsigns.lua @@ -0,0 +1,19 @@ +require('gitsigns').setup { + signs = { + add = {hl = 'DiffAdd' , text = '+'}, + change = {hl = 'DiffChange', text = '!'}, + delete = {hl = 'DiffDelete', text = 'x'}, + topdelete = {hl = 'DiffDelete', text = '-'}, + 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()', + }, + watch_index = { + interval = 1000 + } +} diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index 0228420..4872c19 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -20,6 +20,8 @@ paq 'steelsojka/completion-buffers' -- For tmux paq 'tmux-plugins/vim-tmux-focus-events' -- Git support +paq 'nvim-lua/plenary.nvim' +paq 'lewis6991/gitsigns.nvim' paq 'lambdalisue/gina.vim' paq 'rhysd/git-messenger.vim' paq 'rhysd/conflict-marker.vim'