-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrc
45 lines (38 loc) · 898 Bytes
/
bashrc
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
alias gs="git status"
alias gc="git commit -m"
alias gp="git push -u origin"
alias ls="ls -G"
alias serve="browser-sync start --server -f ."
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1) /'
}
function osx_specific {
alias ls="ls -G"
}
function linux_specific {
alias ls="ls --color"
alias open="xdg-open"
}
# Import colors from bash_colors
[[ -f ~/.bash_colors ]] && . ~/.bash_colors
# Used to determine if terminal supports colors
if [ $TERM = "dumb" ]; then
PS1="\u@\h \w \$(parse_git_branch)$ "
else
PS1="\[${Green}\]\u@\h \[${Purple}\]\w \[${BRed}\]\$(parse_git_branch)\[${Reset}\]$ "
fi
# Detect Operating System
OS=$(uname)
# OS-specific configuration
case "$OS" in
# OSX
Darwin)
git config --system credential.helper "osxkeychain"
osx_specific
;;
Linux)
linux_specific
;;
*) echo "Unknown Operating System"
;;
esac