Last active
October 4, 2018 13:41
-
-
Save arkady-emelyanov/0bbf6dcebe2062cc8e32 to your computer and use it in GitHub Desktop.
fish configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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