master
Mariusz Smykuła 13 years ago
parent 6bab284a10
commit 9e55d5f3e0
  1. 21
      gitprompt.fish

@ -21,9 +21,6 @@ set IBlack (set_color -o black) # Black
# Bold High Intensty # Bold High Intensty
set Magenta (set_color -o purple) # Purple set Magenta (set_color -o purple) # Purple
# Various variables you might want for your PS1 prompt instead
set Time (date +%R)
# Default values for the appearance of the prompt. Configure at will. # Default values for the appearance of the prompt. Configure at will.
set GIT_PROMPT_PREFIX "[" set GIT_PROMPT_PREFIX "["
set GIT_PROMPT_SUFFIX "]" set GIT_PROMPT_SUFFIX "]"
@ -36,16 +33,18 @@ set GIT_PROMPT_REMOTE " "
set GIT_PROMPT_UNTRACKED "…" set GIT_PROMPT_UNTRACKED "…"
set GIT_PROMPT_CLEAN "$BGreen" set GIT_PROMPT_CLEAN "$BGreen"
#Not applied two lines conention from https://github.com/magicmonty/bash-git-prompt/pull/5/files function fish_prompt
# Various variables you might want for your PS1 prompt instead
set Time (date +%R)
set PathShort (pwd|sed "s=$HOME=~=")
set PROMPT_END " \n$WHITE$Time$ResetColor \$ " set PROMPT_START "$Yellow$PathShort$ResetColor"
set PROMPT_END " \n$WHITE$Time$ResetColor \$ "
function fish_prompt
set -e __CURRENT_GIT_STATUS set -e __CURRENT_GIT_STATUS
set gitstatus "$__GIT_PROMPT_DIR/gitstatus.py" set gitstatus "$__GIT_PROMPT_DIR/gitstatus.py"
set PROMPT_START "$Yellow"
set _GIT_STATUS (python $gitstatus) set _GIT_STATUS (python $gitstatus)
set __CURRENT_GIT_STATUS $_GIT_STATUS set __CURRENT_GIT_STATUS $_GIT_STATUS
@ -95,11 +94,13 @@ function fish_prompt
set STATUS "$STATUS$ResetColor$GIT_PROMPT_SUFFIX" set STATUS "$STATUS$ResetColor$GIT_PROMPT_SUFFIX"
set PS1 "$PROMPT_START"(pwd|sed "s=$HOME=~=")"$ResetColor$STATUS$PROMPT_END" set PS1 "$PROMPT_START$STATUS$PROMPT_END"
else else
set PS1 "$PROMPT_START"(pwd|sed "s=$HOME=~=")"$ResetColor$PROMPT_END" set PS1 "$PROMPT_START$PROMPT_END"
end end
echo -e $PS1 echo -e $PS1
end end

Loading…
Cancel
Save