mirror of
https://github.com/oh-my-fish/oh-my-fish.git
synced 2024-11-30 12:33:37 +08:00
21 lines
425 B
Fish
21 lines
425 B
Fish
# name: FishFace
|
|
|
|
function _git_branch_name
|
|
echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
|
|
end
|
|
|
|
function _is_git_dirty
|
|
echo (command git status -s --ignore-submodules=dirty ^/dev/null)
|
|
end
|
|
|
|
function fish_prompt
|
|
set -l blue (set_color -o blue)
|
|
set -l green (set_color -o green)
|
|
|
|
if [ (_git_branch_name) ]
|
|
echo -n -s "$green><(((\"> "
|
|
else
|
|
echo -n -s "$blue><(((\"> "
|
|
end
|
|
end
|