-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash_profile
80 lines (67 loc) · 1.97 KB
/
bash_profile
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# vim: set filetype=sh
# http://railstips.org/blog/archives/2009/02/02/bedazzle-your-bash-prompt-with-git-info/
function git_branch {
ref=$(git symbolic-ref --short HEAD 2> /dev/null)
if [ $? -eq 0 ]; then
echo " "${ref}""
fi
}
function jsonf {
python -mjson.tool
}
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
CYAN="\[\033[0;36m\]"
BLUE="\[\033[0;34m\]"
RED="\[\033[0;31m\]"
LIGHT_RED="\[\033[1;31m\]"
WHITE="\[\033[1;37m\]"
DARK_GRAY="\[\033[1;30m\]"
GRAY="\[\033[0;37m\]"
NO_COLOUR="\[\033[0m\]"
YELLOW_GREEN="\[\033[38;5;148m\]"
# for((color=1;color<=255;color++)); do
# echo -e "\033[38;5;${color}mCOLOR ${color}\033[39m"
# done
# Orange/brown/yellow set
COL1="\[\033[38;5;130m\]"
COL2="\[\033[38;5;172m\]"
COL3="\[\033[38;5;178m\]"
COL4="\[\033[38;5;220m\]"
# Yellow/green set
COL1="\[\033[38;5;136m\]"
COL2="\[\033[38;5;3m\]"
COL3="\[\033[38;5;112m\]"
COL4="\[\033[38;5;2m\]"
export PS1=" $COL2\w$COL3\$(git_branch)$NO_COLOUR "
export CLICOLOR='true'
export LSCOLORS=fxgxcxdxbxegedabagacfx
export EDITOR=vim
# make bash autocomplete with up arrow/down arrow
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'
# readline settings
bind "set completion-ignore-case on"
bind "set bell-style none" # No bell, because it's damn annoying
bind "set show-all-if-ambiguous On" # this allows you to automatically show completion without double tab-ing
alias grep="grep --color=auto"
alias gitx="open -a GitX ."
alias ttr="touch tmp/restart.txt"
alias gitbr='for k in `git branch|perl -pe s/^..//`;do echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k|head -n 1`\\t$k;done|sort -r'
# common
alias cp='cp -i'
alias mv='mv -i'
alias ls='ls -GhF'
alias l='ls -GlAhF'
alias ll='ls -GlAhFtr'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias ps?='ps ax | grep '
alias fn='find . -name'
alias du1='du -h -d 1'
alias gco='git co'
# Make less play nice with git
export LESS="-F -X -R"
# Git autocomplete
complete -o default -o nospace -F _git g