aboutsummaryrefslogtreecommitdiff
path: root/vimrc
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2022-03-17 18:57:12 +0000
committerJuan J. Martinez <jjm@usebox.net>2022-05-29 22:57:31 +0100
commitbe33c0ebd2ebb5d52b4566c9f002874f9f766184 (patch)
treed8d6f20fba8df0c0a9f4e2c3311ca5380a4203af /vimrc
parent1a150722e721e557c3f4b468545ef0b9fccd46e9 (diff)
downloaddotnvim-be33c0ebd2ebb5d52b4566c9f002874f9f766184.tar.gz
dotnvim-be33c0ebd2ebb5d52b4566c9f002874f9f766184.zip
git-gutter status, formatting
Diffstat (limited to 'vimrc')
-rw-r--r--vimrc62
1 files changed, 35 insertions, 27 deletions
diff --git a/vimrc b/vimrc
index 47e802e..3601b99 100644
--- a/vimrc
+++ b/vimrc
@@ -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