Skip to content

Commit 6fb080b

Browse files
committed
-+ nvim : use lewis6991/gitsigns for git signs (replaces gitgutter)
1 parent 5141f0c commit 6fb080b

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

dot_config/nvim/init.vim.tmpl

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ if dein#load_state('~/.cache/dein/')
5959

6060
" Quality of life:
6161

62-
" git gutter
63-
call dein#add('airblade/vim-gitgutter')
62+
" requried for some lua plugins
63+
call dein#add('nvim-lua/plenary.nvim')
64+
65+
" (lua) git signs (replaced airblade/gitgutter)
66+
call dein#add('lewis6991/gitsigns.nvim')
6467

6568
" continuous highlighting, better incsearch
6669
call dein#add('haya14busa/incsearch.vim')
@@ -397,17 +400,23 @@ augroup end
397400
"""
398401

399402

400-
" gitgutter
401-
augroup GitGutterRefresh
402-
autocmd!
403-
autocmd BufWinEnter * silent! :GitGutter
404-
augroup END
405-
406-
set updatetime=100
407-
nmap ghn <Plug>(GitGutterNextHunk)
408-
nmap ghp <Plug>(GitGutterPrevHunk)
409-
nmap <leader>hu <Plug>(GitGutterUndoHunk)
410-
nmap <leader>hs <Plug>(GitGutterStageHunk)
403+
" gitsigns
404+
lua require('gitsigns').setup({
405+
\ numhl = true,
406+
\ current_line_blame = true,
407+
\ current_line_blame_opts = {delay = 500},
408+
\ })
409+
410+
highlight link GitSignsCurrentLineBlame String
411+
" use leader for next/prev hunk commands, otherwise conflicts with python.vim
412+
" movement
413+
nmap ghn :Gitsigns next_hunk<CR>
414+
nmap ghp :Gitsigns prev_hunk<CR>
415+
nmap <leader>hs :Gitsigns stage_hunk<CR>
416+
vmap <leader>hs :'<'>Gitsigns stage_hunk<CR>
417+
nmap <leader>hu :Gitsigns undo_stage_hunk<CR>
418+
nmap <leader>hp :Gitsigns preview_hunk<CR>
419+
nmap <leader>hrp :Gitsigns toggle_current_line_blame<CR>
411420

412421

413422
" deoplete settings

0 commit comments

Comments
 (0)