Skip to content

Instantly share code, notes, and snippets.

@wwqrd
Created April 11, 2014 08:01
Show Gist options
  • Save wwqrd/10448491 to your computer and use it in GitHub Desktop.
Save wwqrd/10448491 to your computer and use it in GitHub Desktop.
happycat
function _git_branch_name
echo (command git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end
function _git_status
set -l git_status (git status --porcelain -z)
if echo "$git_status" | grep -q -E '^$'
echo -n ' ○' # clean
else
echo -n " ● [^._.^]ノ"
if echo "$git_status" | grep -q -E '^ M'
set_color blue
echo -n "彡ミ"
end
if echo "$git_status" | grep -q -E '^ A'
set_color green
echo -n "彡ミ"
end
if echo "$git_status" | grep -q -E '^ D'
set_color red
echo -n "彡ミ"
end
if echo "$git_status" | grep -q -E '^ R'
set_color magenta
echo -n "彡ミ"
end
if echo "$git_status" | grep -q -E '^ C'
set_color yellow
echo -n "彡ミ"
end
if echo "$git_status" | grep -q -E '^ M'
set_color cyan
echo -n "彡ミ"
end
end
end
function _remote_hostname
if test -n "$SSH_CONNECTION"
echo (whoami)@(hostname)
end
end
function fish_prompt
## set -l cyan (set_color cyan)
## set -l normal (set_color normal)
##
## set -l cwd (set_color $fish_color_cwd)(prompt_pwd)
## set -l git_status (_git_status_symbol)(_git_branch_name)
##
## if test -n "$git_status"
## set git_status " $git_status"
## end
##
## echo -n (_remote_hostname) $cwd$cyan$git_status$normal'> '
echo -n (_git_status)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment