Add vim-gitgutter plugin and relevant config
Add gitgutter added/modified/removed count to statusbar
This commit is contained in:
parent
e528b2a095
commit
ca86a91b10
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -43,3 +43,6 @@
|
||||||
[submodule "extras/onehalf"]
|
[submodule "extras/onehalf"]
|
||||||
path = extras/onehalf
|
path = extras/onehalf
|
||||||
url = https://github.com/sonph/onehalf.git
|
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
|
||||||
|
|
1
pack/plugins/start/vim-gitgutter
Submodule
1
pack/plugins/start/vim-gitgutter
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 24cc47789557827209add5881c226243711475ce
|
12
vimrc
12
vimrc
|
@ -8,6 +8,9 @@ set t_TI=""
|
||||||
set t_TE=""
|
set t_TE=""
|
||||||
set t_ut=""
|
set t_ut=""
|
||||||
|
|
||||||
|
set updatetime=1000
|
||||||
|
set signcolumn=yes
|
||||||
|
|
||||||
colorscheme onehalfdark
|
colorscheme onehalfdark
|
||||||
if exists('+termguicolors') && ($COLORTERM == "24bit" || $COLORTERM == "truecolor")
|
if exists('+termguicolors') && ($COLORTERM == "24bit" || $COLORTERM == "truecolor")
|
||||||
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
|
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
|
||||||
|
@ -68,6 +71,11 @@ nnoremap <Leader>b :buffers<CR>:buffer<Space>
|
||||||
set splitbelow
|
set splitbelow
|
||||||
set splitright
|
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:netrw_list_hide= '\(^\|\s\s\)\zs\.\S\+'
|
||||||
|
|
||||||
let g:python_highlight_all = 1
|
let g:python_highlight_all = 1
|
||||||
|
@ -91,13 +99,13 @@ let g:lightline.component_type = {
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
let g:lightline.component_function = {
|
let g:lightline.component_function = {
|
||||||
\ 'gitbranch': 'FugitiveHead'
|
\ 'gitstatus': 'GitStatus'
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
|
|
||||||
let g:lightline.active = {
|
let g:lightline.active = {
|
||||||
\ 'left': [ [ 'mode', 'paste' ],
|
\ 'left': [ [ 'mode', 'paste' ],
|
||||||
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ] ],
|
\ [ 'gitstatus', 'readonly', 'filename', 'modified' ] ],
|
||||||
\ 'right': [ [ 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_infos', 'linter_ok', 'lineinfo' ],
|
\ 'right': [ [ 'linter_checking', 'linter_errors', 'linter_warnings', 'linter_infos', 'linter_ok', 'lineinfo' ],
|
||||||
\ [ 'percent' ],
|
\ [ 'percent' ],
|
||||||
\ [ 'fileformat', 'fileencoding', 'filetype' ] ]
|
\ [ 'fileformat', 'fileencoding', 'filetype' ] ]
|
||||||
|
|
Loading…
Reference in a new issue