Skip to content

Instantly share code, notes, and snippets.

@jasongregori
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasongregori/4bc1fdf5890b91ae9383 to your computer and use it in GitHub Desktop.
Save jasongregori/4bc1fdf5890b91ae9383 to your computer and use it in GitHub Desktop.
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