Skip to content

Instantly share code, notes, and snippets.

@jonathanmarvens
Created July 14, 2013 07:17
Show Gist options
  • Save jonathanmarvens/5993485 to your computer and use it in GitHub Desktop.
Save jonathanmarvens/5993485 to your computer and use it in GitHub Desktop.
function fish_prompt
set last_command_status $status
echo ""
set_color red
echo -n "date:"
set_color normal
echo -n " "
echo -n " "
echo -n " "
set_color yellow
echo -n (date +"%h %d, %Y")
set_color normal
echo ""
set_color red
echo -n "time:"
set_color normal
echo -n " "
echo -n " "
echo -n " "
set_color yellow
echo -n (date +"%H:%M:%S")
set_color normal
echo ""
set_color red
echo -n "status:"
set_color normal
echo -n " "
set_color blue
if test $last_command_status = 0
echo -n "✔"
else
echo -n "✖"
end
set_color normal
echo ""
set git_directory (command git rev-parse --git-dir ^/dev/null)
if test $status = 0
set_color red
echo -n "git:"
set_color normal
echo -n " "
echo -n " "
echo -n " "
echo -n " "
set_color magenta
echo -n $git_directory"/"
set_color normal
echo -n " "
set_color white
echo -n "⇾"
set_color normal
echo -n " "
set_color white
echo -n "["
set_color normal
echo -n " "
set_color magenta
set git_branch (command git symbolic-ref --short HEAD ^/dev/null)
if test $status = 0
echo -n $git_branch
else
echo -n "%unknown%"
end
set -e git_branch
set_color normal
echo -n " "
set_color white
echo -n "]"
set_color normal
echo ""
end
set -e git_directory
set_color red
echo -n "path:"
set_color normal
echo -n " "
echo -n " "
echo -n " "
set_color green
echo -n (hostname -s)
set_color normal
echo -n " "
set_color white
echo -n "::"
set_color normal
echo -n " "
set_color green
echo -n (id -n -u)
set_color normal
echo ""
echo -n " "
echo -n " "
echo -n " "
echo -n " "
echo -n " "
echo -n " "
echo -n " "
echo -n " "
echo -n " "
echo -n " "
set_color white
echo -n "⌊"
set_color normal
echo -n " "
set_color green
echo -n (pwd)
set_color normal
echo ""
echo ""
echo -n " "
set_color cyan
echo -n "♛"
set_color normal
echo -n " "
echo -n " "
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment