forked from longinoa/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrc
82 lines (68 loc) · 1.99 KB
/
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
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
81
82
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
alias kta='ps aux | grep "tmux attach" | grep -v "grep" | awk "{print \$2}" | xargs kill -9'
alias ta='kta; tmux attach'
alias hl='hphpd -h localhost'
alias gca='git commit -a --amend -C HEAD'
alias frb='git fetch; git rebase trunk; arc build'
export EDITOR=vim
export PATH=$PATH:~/bin
if [ $TERM = xterm ]
then
export TERM=xterm-256color
elif [ $TERM = screen ]
then
export TERM=screen-256color
elif [ $TERM = linux ]
then
~/.dotfiles/solarized-linux-console.sh
fi
eval `dircolors ~/.dotfiles/dir_colors`
stty -ixon
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
# append to the history file, don't overwrite it
shopt -s histappend
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=10000
HISTFILESIZE=20000
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias ls='ls --color=auto'
alias ll='ls -lh'
alias la='ls -A'
alias l='ls -CF'
# git prompt, if it's available
function safe_git_ps1() {
if [[ `type -t __git_ps1` = function ]]
then
__git_ps1 %s
fi
}
export PS1="\[\e[0;36m\]\u@\h\[\e[m\] \[\e[0;34m\]\w\[\e[m\] \[\e[0;33m\]\$(safe_git_ps1)\[\e[m\]\$ "
# fixing ssh-agent issues in tmux
function fixauth() {
if [[ -n $TMUX ]]; then
#TMUX gotta love it
eval $(tmux showenv | grep -vE "^-" | awk -F = '{print "export "$1"=\""$2"\""}')
fi
}
# hook for preexec
preexec () { fixauth; }
preexec_invoke_exec () {
[ -n "$COMP_LINE" ] && return # do nothing if completing
local this_command=`history 1 | sed -e "s/^[ ]*[0-9]*[ ]*//g"`;
preexec "$this_command"
}
trap 'preexec_invoke_exec' DEBUG
# Load settings specific to this machine.
local_bashrc=~/.bashrc.local
if [ -e "$local_bashrc" ]
then
source "$local_bashrc"
fi
# load git completion
git_completion=~/.git-completion.bash
source "$git_completion"