Skip to content

Instantly share code, notes, and snippets.

@cnandreu
Created June 4, 2013 07:33
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 cnandreu/5704233 to your computer and use it in GitHub Desktop.
Save cnandreu/5704233 to your computer and use it in GitHub Desktop.
~/.config/fish/functions/fish_prompt.fish
function fish_prompt
if not set -q __git_cb
set __git_cb (set_color magenta)(git branch ^/dev/null | grep \* | sed 's/* //')(set_color normal)
end
echo #space between commands
set_color yellow
printf '%s' (whoami)
set_color normal
printf ' @ '
set_color cyan
printf '%s' (hostname|cut -d . -f 1)
set_color normal
printf ' in '
set_color $fish_color_cwd
printf '%s %s' (prompt_pwd) $__git_cb
set_color normal
# Line 2
echo
if test $VIRTUAL_ENV
printf "(%s)" (set_color blue)(basename $VIRTUAL_ENV)(set_color normal)
end
printf '↪ '
set_color normal
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment