nvim: Use gitsigns

Currently there is an observable bug where this doesn't play well with
gina buffers. Perhaps it should be disabled for any gina buffers or
something similar.
This commit is contained in:
Sanchayan Maity 2020-10-27 21:31:11 +05:30
parent d0687b7f1a
commit 21167993bf
3 changed files with 22 additions and 0 deletions

View file

@ -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'

View file

@ -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'] = '<cmd>lua require("gitsigns").next_hunk()<CR>',
['[c'] = '<cmd>lua require("gitsigns").prev_hunk()<CR>',
['ghs'] = '<cmd>lua require("gitsigns").stage_hunk()<CR>',
['ghu'] = '<cmd>lua require("gitsigns").undo_stage_hunk()<CR>',
['ghr'] = '<cmd>lua require("gitsigns").reset_hunk()<CR>',
},
watch_index = {
interval = 1000
}
}

View file

@ -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'