Last active
August 29, 2015 14:03
-
-
Save jasongregori/4bc1fdf5890b91ae9383 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
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_right_prompt | |
set -l cyan (set_color cyan) | |
set -l red (set_color red) | |
set -l normal (set_color normal) | |
set -l yellow (set_color cccc00) | |
set -l green (set_color 80ff00) | |
set -l pink (set_color ff99ff) | |
set -l dark_pink (set_color cc99ff) | |
# Show git branch and dirty state | |
if [ (_git_branch_name) ] | |
set -l git_branch (_git_branch_name) | |
if [ (_is_git_dirty) ] | |
echo -n -s $cyan '‹' $yellow $git_branch $red '*' $cyan '›' $normal | |
else | |
echo -n -s $cyan '‹' $yellow $git_branch $cyan '›' $normal | |
end | |
end | |
end | |
function fish_prompt | |
set_color $fish_color_cwd | |
echo -n (prompt_pwd) | |
set_color normal | |
echo -n ' > ' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment