Created
April 2, 2012 11:16
-
-
Save dubgeiser/2282745 to your computer and use it in GitHub Desktop.
Get git branch 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
| " @return string The git branch we're in, empty if none. | |
| function! functions#git_branch() | |
| return system("git branch 2>/dev/null | grep '^\*' | sed 's/^\* //'") | |
| endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment