Created
January 27, 2015 00:02
-
-
Save skorokithakis/78d015c81898e7659e63 to your computer and use it in GitHub Desktop.
Fish git prompt
This file contains hidden or 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 -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 | |
set -l last_status $status | |
if not set -q __fish_prompt_hostname | |
set -g __fish_prompt_hostname (set_color 6ff)(hostname|cut -d . -f 1)(set_color normal) | |
end | |
printf '%s@%s:' $USER $__fish_prompt_hostname | |
# PWD | |
set_color $fish_color_cwd | |
echo -n (prompt_pwd) | |
set_color normal | |
printf '%s ' (__fish_git_prompt) | |
if not test $last_status -eq 0 | |
set_color $fish_color_error | |
end | |
printf '$ ' | |
set_color normal | |
z --add "$PWD" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment