parent
8a2060598b
commit
66e5b86979
@ -0,0 +1,110 @@ |
|||||||
|
set -x TERM xterm-256color |
||||||
|
|
||||||
|
set BROWSER open |
||||||
|
set TERM xterm-256color |
||||||
|
|
||||||
|
set -g -x fish_greeting '' |
||||||
|
set -g -x EDITOR nano |
||||||
|
|
||||||
|
if status --is-interactive |
||||||
|
command fortune -s | cowsay |
||||||
|
end |
||||||
|
|
||||||
|
if set -q $__GIT_PROMPT_DIR |
||||||
|
set __GIT_PROMPT_DIR ~/.bash |
||||||
|
end |
||||||
|
|
||||||
|
# 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 green) # Green |
||||||
|
|
||||||
|
# High Intensty |
||||||
|
set IBlack (set_color black) # Black |
||||||
|
|
||||||
|
# Bold High Intensty |
||||||
|
set Magenta (set_color purple) # Purple |
||||||
|
|
||||||
|
# Various variables you might want for your PS1 prompt instead |
||||||
|
set Time (date +%X) |
||||||
|
set PathShort (pwd|sed "s=$HOME=~=") #(prompt_pwd) |
||||||
|
|
||||||
|
# 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_CLEAN "$BGreen✔" |
||||||
|
|
||||||
|
#Not applied two lines conention from https://github.com/magicmonty/bash-git-prompt/pull/5/files |
||||||
|
set PROMPT_START "$IBlack$Time $ResetColor$Yellow$PathShort$ResetColor" |
||||||
|
set PROMPT_END " \$ " |
||||||
|
|
||||||
|
function fish_prompt |
||||||
|
set -e __CURRENT_GIT_STATUS |
||||||
|
set gitstatus "$__GIT_PROMPT_DIR/gitstatus.py" |
||||||
|
|
||||||
|
set _GIT_STATUS (python $gitstatus) |
||||||
|
set __CURRENT_GIT_STATUS $_GIT_STATUS |
||||||
|
set GIT_BRANCH $__CURRENT_GIT_STATUS[1] |
||||||
|
set GIT_REMOTE $__CURRENT_GIT_STATUS[2] |
||||||
|
if test "." -eq $GIT_REMOTE |
||||||
|
set -e GIT_REMOTE |
||||||
|
end |
||||||
|
set GIT_STAGED $__CURRENT_GIT_STATUS[3] |
||||||
|
set GIT_CONFLICTS $__CURRENT_GIT_STATUS[4] |
||||||
|
set GIT_CHANGED $__CURRENT_GIT_STATUS[5] |
||||||
|
set GIT_UNTRACKED $__CURRENT_GIT_STATUS[6] |
||||||
|
set GIT_CLEAN $__CURRENT_GIT_STATUS[7] |
||||||
|
|
||||||
|
if test -n "$__CURRENT_GIT_STATUS" |
||||||
|
set STATUS " $GIT_PROMPT_PREFIX$GIT_PROMPT_BRANCH$GIT_BRANCH$ResetColor" |
||||||
|
|
||||||
|
if test -n $GIT_REMOTE |
||||||
|
set STATUS "$STATUS$GIT_PROMPT_REMOTE$GIT_REMOTE$ResetColor" |
||||||
|
end |
||||||
|
|
||||||
|
set STATUS "$STATUS$GIT_PROMPT_SEPARATOR" |
||||||
|
|
||||||
|
if test $GIT_STAGED -ne "0" |
||||||
|
set STATUS "$STATUS$GIT_PROMPT_STAGED$GIT_STAGED$ResetColor" |
||||||
|
end |
||||||
|
|
||||||
|
if test $GIT_CONFLICTS -ne "0" |
||||||
|
set STATUS "$STATUS$GIT_PROMPT_CONFLICTS$GIT_CONFLICTS$ResetColor" |
||||||
|
end |
||||||
|
|
||||||
|
if test $GIT_CHANGED -ne "0" |
||||||
|
set STATUS "$STATUS$GIT_PROMPT_CHANGED$GIT_CHANGED$ResetColor" |
||||||
|
end |
||||||
|
|
||||||
|
if test "$GIT_UNTRACKED" -ne "0" |
||||||
|
set STATUS "$STATUS$GIT_PROMPT_UNTRACKED$GIT_UNTRACKED$ResetColor" |
||||||
|
end |
||||||
|
|
||||||
|
if test "$GIT_CLEAN" -eq "1" |
||||||
|
set STATUS "$STATUS$GIT_PROMPT_CLEAN" |
||||||
|
end |
||||||
|
|
||||||
|
set STATUS "$STATUS$ResetColor$GIT_PROMPT_SUFFIX" |
||||||
|
set PS1 "$PROMPT_START$STATUS$PROMPT_END" |
||||||
|
else |
||||||
|
set PS1 "$PROMPT_START$PROMPT_END" |
||||||
|
end |
||||||
|
echo -e $PS1 |
||||||
|
end |
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in new issue