Closes #3: Remove dependency of git plugin from robbyrussell theme

This commit is contained in:
Bruno Pinto 2012-08-09 20:40:09 -03:00
parent 64cd07aec0
commit 4996bb18bc
3 changed files with 11 additions and 9 deletions

View File

@ -1,3 +0,0 @@
function git_branch_name
echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end

View File

@ -1,3 +0,0 @@
function is_git_dirty
echo (git status -s --ignore-submodules=dirty ^/dev/null)
end

View File

@ -1,3 +1,11 @@
function _git_branch_name
echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end
function _is_git_dirty
echo (git status -s --ignore-submodules=dirty ^/dev/null)
end
function fish_prompt
set -l cyan (set_color -o cyan)
set -l yellow (set_color -o yellow)
@ -8,11 +16,11 @@ function fish_prompt
set -l arrow "$red"
set -l cwd $cyan(basename (prompt_pwd))
if [ (git_branch_name) ]
set -l git_branch $red(git_branch_name)
if [ (_git_branch_name) ]
set -l git_branch $red(_git_branch_name)
set git_info "$blue git:($git_branch$blue)"
if [ (is_git_dirty) ]
if [ (_is_git_dirty) ]
set -l dirty "$yellow"
set git_info "$git_info$dirty"
end