Created
July 15, 2014 14:25
-
-
Save brycemcd/9c711723dd3d3f88a648 to your computer and use it in GitHub Desktop.
Adds # of lines changed to vim statusline
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" NOTE: currently appends a "^@" to the end of the line and I haven't | |
" taken the time to get rid of that | |
function! LinesChanged() | |
let dif=system('git diff --stat -- '. bufname('%') .'| cut -d"|" -f2 | head -n 1') | |
return dif | |
endfunction | |
" statusbar: | |
set statusline= " clear the line | |
set statusline+=Buf:#%n\ %f\ %m\ %r | |
set statusline+=\ Line:%l/%L\ [%p%%] | |
set statusline+=\ Col:%c | |
set statusline+=%= " move to the right | |
set statusline+=\ %{LinesChanged()} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment