Skip to content

Instantly share code, notes, and snippets.

@tawrahim
Created May 11, 2013 16:33
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tawrahim/5560502 to your computer and use it in GitHub Desktop.
Save tawrahim/5560502 to your computer and use it in GitHub Desktop.
An informative status line in vim
" 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