Skip to content

Instantly share code, notes, and snippets.

@rasky
Created February 20, 2016 01:00
Show Gist options
  • Save rasky/fd9f6ec564466dcfcc07 to your computer and use it in GitHub Desktop.
Save rasky/fd9f6ec564466dcfcc07 to your computer and use it in GitHub Desktop.
Fish prompt
set -g __fish_git_prompt_show_informative_status 1
set -g __fish_git_prompt_hide_untrackedfiles 1
set -g __fish_git_prompt_color_branch magenta --bold
set -g __fish_git_prompt_showupstream "informative"
set -g __fish_git_prompt_char_upstream_ahead "↑"
set -g __fish_git_prompt_char_upstream_behind "↓"
set -g __fish_git_prompt_char_upstream_prefix ""
set -g __fish_git_prompt_char_stagedstate "●"
set -g __fish_git_prompt_char_dirtystate "✚"
set -g __fish_git_prompt_char_untrackedfiles "…"
set -g __fish_git_prompt_char_conflictedstate "✖"
set -g __fish_git_prompt_char_cleanstate "✔"
set -g __fish_git_prompt_color_dirtystate blue
set -g __fish_git_prompt_color_stagedstate yellow
set -g __fish_git_prompt_color_invalidstate red
set -g __fish_git_prompt_color_untrackedfiles $fish_color_normal
set -g __fish_git_prompt_color_cleanstate green --bold
function fish_prompt
tput el # clean line
set_color yellow
printf '%s' (whoami)
set_color normal
printf ' at '
set_color magenta
printf '%s' (hostname|cut -d . -f 1)
set_color normal
printf ' in '
set_color $fish_color_cwd
printf '%s' (prompt_pwd)
set_color normal
printf '%s' (__fish_git_prompt)
# Line 2
echo
tput el
if test "$VIRTUAL_ENV"
printf "(%s) " (set_color red)py:(set_color blue)(basename $VIRTUAL_ENV)(set_color normal)
end
if test "$GOPATH" != "$HOME/Sources/go"
printf "(%s) " (set_color red)go:(set_color blue)(basename $GOPATH)(set_color normal)
end
printf '↪ '
set_color normal
#if not test $status -eq 0
# set_color $fish_color_error
#end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment