Skip to content

Instantly share code, notes, and snippets.

@arkady-emelyanov
Last active October 4, 2018 13:41
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 arkady-emelyanov/0bbf6dcebe2062cc8e32 to your computer and use it in GitHub Desktop.
Save arkady-emelyanov/0bbf6dcebe2062cc8e32 to your computer and use it in GitHub Desktop.
fish configuration
set fish_greeting
set -gx LANG en_US.UTF-8
set -gx LC_MESSAGES en_US.UTF-8
set -gx LC_ALL en_US.UTF-8
set -gx EDITOR nano
set fish_color_error ff8a00
# c0 to c4 progress from dark to bright
# ce is the error colour
set -g c0 (set_color 005284)
set -g c1 (set_color 0075cd)
set -g c2 (set_color 009eff)
set -g c3 (set_color 6dc7ff)
set -g c4 (set_color ffffff)
set -g ce (set_color $fish_color_error)
set fish_git_dirty_color red
set fish_git_not_dirty_color white
function parse_git_branch
set -l branch (git branch 2> /dev/null | grep -e '\* ' | sed 's/^..\(.*\)/\1/')
set -l git_status (git status -s)
if test -n "$git_status"
echo (set_color $fish_git_dirty_color)$branch(set_color normal)
else
echo (set_color $fish_git_not_dirty_color)$branch(set_color normal)
end
end
function fish_prompt
set -l git_dir (git rev-parse --git-dir 2> /dev/null)
if test -n "$git_dir"
printf '%s%s%s [%s] > ' (set_color $fish_color_cwd) (prompt_pwd) (set_color normal) (parse_git_branch)
else
printf '%s%s%s > ' (set_color $fish_color_cwd) (prompt_pwd) (set_color normal)
end
end
function fish_right_prompt
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment