Add vim-gitgutter plugin and relevant config

Add gitgutter added/modified/removed count to statusbar
This commit is contained in:
Edward Litherland-Smith 2021-03-29 14:31:11 +01:00
parent e528b2a095
commit ca86a91b10
3 changed files with 14 additions and 2 deletions

3
.gitmodules vendored
View file

@ -43,3 +43,6 @@
[submodule "extras/onehalf"]
path = extras/onehalf
url = https://github.com/sonph/onehalf.git
[submodule "pack/plugins/start/vim-gitgutter"]
path = pack/plugins/start/vim-gitgutter
url = https://github.com/airblade/vim-gitgutter.git

@ -0,0 +1 @@
Subproject commit 24cc47789557827209add5881c226243711475ce

12
vimrc
View file

@ -8,6 +8,9 @@ set t_TI=""
set t_TE=""
set t_ut=""
set updatetime=1000
set signcolumn=yes
colorscheme onehalfdark
if exists('+termguicolors') && ($COLORTERM == "24bit" || $COLORTERM == "truecolor")
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
@ -68,6 +71,11 @@ nnoremap <Leader>b :buffers<CR>:buffer<Space>
set splitbelow
set splitright
function! GitStatus()
let [a,m,r] = GitGutterGetHunkSummary()
return printf('%s +%d ~%d -%d', FugitiveHead(), a, m, r)
endfunction
let g:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+'
let g:python_highlight_all = 1
@ -91,13 +99,13 @@ let g:lightline.component_type = {
\ }
let g:lightline.component_function = {
\ 'gitbranch': 'FugitiveHead'
\ 'gitstatus': 'GitStatus'
\ }
let g:lightline.active = {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ],
\ [ 'gitstatus', 'readonly', 'filename', 'modified' ] ],
\ 'right': [ [ 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_infos', 'linter_ok', 'lineinfo' ],
\ [ 'percent' ],
\ [ 'fileformat', 'fileencoding', 'filetype' ] ]