Skip to content

Instantly share code, notes, and snippets.

@tawrahim
Created May 11, 2013 16:33
Show Gist options
  • Select an option

  • Save tawrahim/5560502 to your computer and use it in GitHub Desktop.

Select an option

Save tawrahim/5560502 to your computer and use it in GitHub Desktop.

Revisions

  1. tawrahim created this gist May 11, 2013.
    15 changes: 15 additions & 0 deletions vim status line
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    " 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