-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdotBashrc
More file actions
64 lines (41 loc) · 1.07 KB
/
Copy pathdotBashrc
File metadata and controls
64 lines (41 loc) · 1.07 KB
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
55
56
57
58
59
60
61
62
63
#
# ~/.bashrc
#
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# Color Base16
BASE16_SHELL=$HOME/.config/base16-shell/
[ -n "$PS1" ] && [ -s $BASE16_SHELL/profile_helper.sh ] && eval "$($BASE16_SHELL/profile_helper.sh)"
# Path
PATH=$PATH":~/gitReps/powerline-shell:"
# Prompt
# Turn on colored prompt
force_color_prompt=yes
parse_git_branch(){
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
PS1=""
function _update(){
if [ "$color_prompt"=yes ];then
branch="$(parse_git_branch)"
if [ ${#branch} != 0 ]; then
if [ "$branch" == '(master)' ];then
branch=' \e[0;31m'$branch'\e[m '
else
branch=' \e[0;32m'$branch'\e[m '
fi
fi
PS1="\u » \W $branch\$ "
else
PS1='\u@\h \W $(parse_git_branch)\$ '
fi
}
PROMPT_COMMAND="_update; $PROMPT_COMMAND"
unset color_prompt force_color_prompt
#PS1=""
#function _update_ps1(){
# PS1="$(powerline-shell.py $? 2> /dev/null)"
#}
#PROMPT_COMMAND="_update_ps1; $PROMPT_COMMAND"
alias ls='ls --color=auto'
alias la='ls --color=auto -la'