Created
August 22, 2012 08:51
-
-
Save nychng/3423858 to your computer and use it in GitHub Desktop.
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
"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 | |
function! CurDir() | |
return substitute(getcwd(), '/Users/amir/', "~/", "g") | |
endfunction | |
function! HasPaste() | |
if &paste | |
return 'PASTE MODE ' | |
en | |
return '' | |
endfunction | |
" Format the statusline | |
set statusline=\ %{HasPaste()}%F%m%r%h\ %w\ \ CWD:\ %r%{CurDir()}%h\ \ \ Line:\ %l/%L%{GitBranch()} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment