-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bashrc.custom
46 lines (36 loc) · 1.12 KB
/
.bashrc.custom
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
#Always prefer vim
export EDITOR=vim
#Some bsd systems use more as the default pager...
export PAGER=less
#Ensure 256 color support in terminal apps
export TERM=xterm-256color
#Don't break linewrapping when resizing console window
shopt -s checkwinsize
#Solarized theme for gnu utils
if [ "`uname`" != "FreeBSD" ]; then
eval `dircolors ~/.dircolors`
fi
#Add magic git hooks for prompt
. ~/.git-prompt.sh
#-------------------------------------
#Bash Prompt
#-------------------------------------
#Prevent \w from taking too much screen space
export PROMPT_DIRTRIM=3
#Colors
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
PURPLE="$(tput setaf 5)"
BLUE="$(tput setaf 6)"
ORANGE="$(tput setaf 9)"
RESET="$(tput sgr0)"
#Now create the prompt
#Show result of last command
export PS1='`if [ $? = 0 ]; then echo "\[${GREEN}\]+"; else echo "\[${ORANGE}\]-\[${GREEN}\]"; fi`'
#Username@host:(git branch)cwd
export PS1+='\u@\h:\[${ORANGE}\]$(__git_ps1 "[%s]")\[${YELLOW}\]\w'
#Show number of jobs if at least one job
export PS1+='`if [ -n "$(jobs)" ]; then echo "\[${BLUE}\](\j)"; fi`'
#Finish
export PS1+='\[${RESET}\]\$ '