Created
May 11, 2013 16:33
-
-
Save tawrahim/5560502 to your computer and use it in GitHub Desktop.
An informative status line in vim
This file contains hidden or 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
" show little divider at bottom of vim | |
set laststatus=2 | |
"an informative status line | |
set statusline=\[%t%m]\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [LINE=%04l,COL=%04v]\ %{GitBranch()} | |
" Function to display git branch | |
function! GitBranch() | |
let branch = system("git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* //'") | |
if branch != '' | |
return '[Git Branch: ' . substitute(branch, '\n', '', 'g') . ']' | |
en | |
return '' | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment