-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.bash_prompt
54 lines (44 loc) · 1.38 KB
/
.bash_prompt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
load_zsh_prompt() {
# %F/%f: start/end Foreground color
# %F{m}/%F{g}/%F{c}: short for %F{magenta}/%F{green}%F{cyan}
# %B/%b: start/end Bold/Bright (depending on your terminal)
# %n: user name
# %m: machine name
# %*: 24h time w/ seconds
# %~: pwd, abbreviated
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git svn
zstyle ':vcs_info:git*' formats "(%b) "
precmd() { vcs_info }
setopt prompt_subst
export PROMPT='%B%F{yellow}%~%F{cyan} %F{red}${vcs_info_msg_0_}%f%F{w}❯%f %f%b'
}
load_bash_prompt() {
PROMPT_BOLD="$(tput bold)"
PROMPT_UNDERLINE="$(tput smul)"
PROMPT_FG_RED="$(tput setaf 1)"
PROMPT_FG_GREEN="$(tput setaf 2)"
PROMPT_FG_CYAN="$(tput setaf 6)"
PROMPT_FG_YELLOW="$(tput setaf 3)"
PROMPT_FG_MAGENTA="$(tput setaf 5)"
PROMPT_FG_WHITE="$(tput setaf 7)"
PROMPT_RESET="$(tput sgr0)"
ARROW="❯"
#PROMPT_EMOJI=$'\xf0\x9f\x94\xa5'
PROMPT_ARROW="\[$PROMT_BOLD$PROMPT_FG_WHITE\]$ARROW\[$PROMPT_RESET\]"
PROMPT_DIRECTORY="\[$PROMPT_BOLD$PROMPT_FG_YELLOW\]\W\[$PROMPT_RESET\]"
PROMPT_GIT_BRANCH="\[$PROMPT_BOLD$PROMPT_FG_RED\]\$(__git_ps1 \" (%s)\")"
PS1=""
PS1+="$PROMPT_DIRECTORY"
PS1+="$PROMPT_GIT_BRANCH"
PS1+=" $PROMPT_ARROW"
PS1+="\[$PROMPT_RESET\] "
export PS1
}
if [ -n "$ZSH_VERSION" ]; then
load_zsh_prompt
elif [ -n "$BASH_VERSION" ]; then
load_bash_prompt
else
echo "Failed to detech shell to set prompt"
fi