Fix fish_prompt function.

master
Paweł Korzeniewski 8 years ago
parent d0bdc7d9a2
commit 9c82beddd7
  1. 72
      gitprompt.fish

@ -1,43 +1,43 @@
# name: bash-git-prompt # name: bash-git-prompt
# author: Mariusz Smykuła <mariuszs@gmail.com> # author: Mariusz Smykuła <mariuszs@gmail.com>
if not set -q __GIT_PROMPT_DIR function fish_prompt
set __GIT_PROMPT_DIR ~/.bash-git-prompt
end
# Colors if not set -q __GIT_PROMPT_DIR
# Reset set __GIT_PROMPT_DIR ~/.bash-git-prompt
set ResetColor (set_color normal) # Text Reset end
# Regular Colors
set Red (set_color red) # Red
set Yellow (set_color yellow); # Yellow
set Blue (set_color blue) # Blue
set WHITE (set_color white)
# Bold
set BGreen (set_color -o green) # Green
# High Intensty
set IBlack (set_color -o black) # Black
# Bold High Intensty
set Magenta (set_color -o purple) # Purple
# Default values for the appearance of the prompt. Configure at will.
set GIT_PROMPT_PREFIX "["
set GIT_PROMPT_SUFFIX "]"
set GIT_PROMPT_SEPARATOR "|"
set GIT_PROMPT_BRANCH "$Magenta"
set GIT_PROMPT_STAGED "$Red"
set GIT_PROMPT_CONFLICTS "$Red"
set GIT_PROMPT_CHANGED "$Blue"
set GIT_PROMPT_REMOTE " "
set GIT_PROMPT_UNTRACKED "…"
set GIT_PROMPT_STASHED "⚑ "
set GIT_PROMPT_CLEAN "$BGreen"
function fish_prompt # Colors
# Reset
set ResetColor (set_color normal) # Text Reset
# Regular Colors
set Red (set_color red) # Red
set Yellow (set_color yellow); # Yellow
set Blue (set_color blue) # Blue
set WHITE (set_color white)
# Bold
set BGreen (set_color -o green) # Green
# High Intensty
set IBlack (set_color -o black) # Black
# Bold High Intensty
set Magenta (set_color -o purple) # Purple
# Default values for the appearance of the prompt. Configure at will.
set GIT_PROMPT_PREFIX "["
set GIT_PROMPT_SUFFIX "]"
set GIT_PROMPT_SEPARATOR "|"
set GIT_PROMPT_BRANCH "$Magenta"
set GIT_PROMPT_STAGED "$Red"
set GIT_PROMPT_CONFLICTS "$Red"
set GIT_PROMPT_CHANGED "$Blue"
set GIT_PROMPT_REMOTE " "
set GIT_PROMPT_UNTRACKED "…"
set GIT_PROMPT_STASHED "⚑ "
set GIT_PROMPT_CLEAN "$BGreen"
# Various variables you might want for your PS1 prompt instead # Various variables you might want for your PS1 prompt instead
set Time (date +%R) set Time (date +%R)
@ -92,7 +92,7 @@ function fish_prompt
if [ "$GIT_UNTRACKED" != "0" ] if [ "$GIT_UNTRACKED" != "0" ]
set STATUS "$STATUS$GIT_PROMPT_UNTRACKED$GIT_UNTRACKED$ResetColor" set STATUS "$STATUS$GIT_PROMPT_UNTRACKED$GIT_UNTRACKED$ResetColor"
end end
if [ "$GIT_STASHED" != "0" ] if [ "$GIT_STASHED" != "0" ]
set STATUS "$STATUS$GIT_PROMPT_STASHED$GIT_STASHED$ResetColor" set STATUS "$STATUS$GIT_PROMPT_STASHED$GIT_STASHED$ResetColor"
end end

Loading…
Cancel
Save