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

pull/2/head
Bruno Pinto 12 years ago
parent 64cd07aec0
commit 4996bb18bc

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

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

@ -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

Loading…
Cancel
Save