Skip to content

Instantly share code, notes, and snippets.

@jul-sh
Created January 27, 2019 21:59
Show Gist options
  • Save jul-sh/d64bb4775f937fdbc0ce9982f5bbc206 to your computer and use it in GitHub Desktop.
Save jul-sh/d64bb4775f937fdbc0ce9982f5bbc206 to your computer and use it in GitHub Desktop.
function fish_prompt
set -l last_status $status
set -l cyan (set_color -o cyan)
set -l yellow (set_color -o yellow)
set -l red (set_color -o AE111D)
set -l blue (set_color -o blue)
set -l green (set_color -o green)
if not set -q __fish_git_prompt_show_informative_status
set -g __fish_git_prompt_show_informative_status 1
end
if not set -q __fish_git_prompt_hide_untrackedfiles
set -g __fish_git_prompt_hide_untrackedfiles 1
end
if not set -q __fish_git_prompt_color_branch
set -g __fish_git_prompt_color_branch 62dede
end
if not set -q __fish_git_prompt_showupstream
set -g __fish_git_prompt_showupstream "informative"
end
if not set -q __fish_git_prompt_char_upstream_ahead
set -g __fish_git_prompt_char_upstream_ahead "↑"
end
if not set -q __fish_git_prompt_char_upstream_behind
set -g __fish_git_prompt_char_upstream_behind "↓"
end
if not set -q __fish_git_prompt_char_upstream_prefix
set -g __fish_git_prompt_char_upstream_prefix ""
end
if not set -q __fish_git_prompt_char_stagedstate
set -g __fish_git_prompt_char_stagedstate "●"
end
if not set -q __fish_git_prompt_char_dirtystate
set -g __fish_git_prompt_char_dirtystate "✚"
end
if not set -q __fish_git_prompt_char_untrackedfiles
set -g __fish_git_prompt_char_untrackedfiles "…"
end
if not set -q __fish_git_prompt_char_conflictedstate
set -g __fish_git_prompt_char_conflictedstate "✖"
end
if not set -q __fish_git_prompt_char_cleanstate
set -g __fish_git_prompt_char_cleanstate "✔"
end
if not set -q __fish_git_prompt_color_dirtystate
set -g __fish_git_prompt_color_dirtystate blue
end
if not set -q __fish_git_prompt_color_stagedstate
set -g __fish_git_prompt_color_stagedstate yellow
end
if not set -q __fish_git_prompt_color_invalidstate
set -g __fish_git_prompt_color_invalidstate red
end
if not set -q __fish_git_prompt_color_untrackedfiles
set -g __fish_git_prompt_color_untrackedfiles $fish_color_normal
end
if not set -q __fish_git_prompt_color_cleanstate
set -g __fish_git_prompt_color_cleanstate green
end
set -l last_status $status
if not set -q __fish_prompt_normal
set -g __fish_prompt_normal (set_color normal)
end
# git Status
set -l gitstatus (__fish_vcs_prompt)
function aliasUser
if [ $USER = "laurapretot" ]; or [ $USER = "juliettepretot" ]
echo "🦖 "
else
echo $USER
end
end
set -l userAlias (aliasUser)
function aliasHost
set -l where (hostname|cut -d . -f 1)
if [ $where = "Rosa" ]
echo "🏡 "
else if [ $where = "Juliette-Pretot" ]
echo "👩🏻‍💻 "
else if [ $where = "ip-10-21-101-110" ]
echo "👩🏻‍💻 "
else
echo $where
end
end
set -l hostAlias (aliasHost)
set -l pwd (prompt_pwd)
set_color white
echo -n -s "$userAlias "
set_color 62dede
echo -n -s "@ "
set_color white
echo -n -s "$hostAlias "
set_color 9e7df7
echo -n -s "$pwd"
set_color white
echo -n -s "$gitstatus: "
set_color $arrowcol -b normal
end
function fish_greeting
set_color FEB9C5
echo 'Hey girl. You are doing awesome today. ✨'
set_color f2e68c
end
# git repository where I store my dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment