diff options
author | Juan J. Martinez <jjm@usebox.net> | 2022-03-17 18:57:12 +0000 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2022-05-29 22:57:31 +0100 |
commit | be33c0ebd2ebb5d52b4566c9f002874f9f766184 (patch) | |
tree | d8d6f20fba8df0c0a9f4e2c3311ca5380a4203af | |
parent | 1a150722e721e557c3f4b468545ef0b9fccd46e9 (diff) | |
download | dotnvim-be33c0ebd2ebb5d52b4566c9f002874f9f766184.tar.gz dotnvim-be33c0ebd2ebb5d52b4566c9f002874f9f766184.zip |
git-gutter status, formatting
-rw-r--r-- | vimrc | 62 |
1 files changed, 35 insertions, 27 deletions
@@ -92,36 +92,44 @@ call plug#end() " metals status function! MetalsStatus() abort - return get(g:, 'metals_status', '') + return get(g:, 'metals_status', '') endfunction +" git-gutter status +" +function! GitStatus() + let [a,m,r] = GitGutterGetHunkSummary() + return printf('+%d ~%d -%d', a, m, r) +endfunction + + function! StatusLine(current, width) - let l:s = '' - - if a:current - let l:s .= crystalline#mode() . crystalline#right_mode_sep('') - else - let l:s .= '%#CrystallineInactive#' - endif - let l:s .= ' %<%f%h%w%m%r ' - - if a:current - let l:s .= crystalline#right_sep('', 'Fill') . ' %{fugitive#statusline()}' - endif - - let l:s .= '%=' - if a:current - let l:s .= ' %{MetalsStatus()} ' - let l:s .= crystalline#left_sep('', 'Fill') . ' %{&paste ?"PASTE ":""}%{&spell?"SPELL ":""}' - let l:s .= crystalline#left_mode_sep('') - endif - if a:width > 80 - let l:s .= ' %{&ft} [%{&fenc!=#""?&fenc:&enc}][%{&ff}] %3(%c%V%) %l/%L %P ' - else - let l:s .= ' ' - endif - - return l:s + let l:s = '' + + if a:current + let l:s .= crystalline#mode() . crystalline#right_mode_sep('') + else + let l:s .= '%#CrystallineInactive#' + endif + let l:s .= ' %<%f%h%w%m%r ' + + if a:current + let l:s .= crystalline#right_sep('', 'Fill') . ' %{fugitive#statusline()}' .' %{GitStatus()}' + endif + + let l:s .= '%=' + if a:current + let l:s .= ' %{MetalsStatus()} ' + let l:s .= crystalline#left_sep('', 'Fill') . ' %{&paste ?"PASTE ":""}%{&spell?"SPELL ":""}' + let l:s .= crystalline#left_mode_sep('') + endif + if a:width > 80 + let l:s .= ' %{&ft} [%{&fenc!=#""?&fenc:&enc}][%{&ff}] %3(%c%V%) %l/%L %P ' + else + let l:s .= ' ' + endif + + return l:s endfunction let g:crystalline_enable_sep = 1 |