forked from sontek/homies
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path_bashrc
More file actions
178 lines (146 loc) · 4.93 KB
/
Copy path_bashrc
File metadata and controls
178 lines (146 loc) · 4.93 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
PATH="$HOME/bin:/usr/local/bin:/usr/local/sbin:/usr/local/share/python:/var/lib/gems/1.8/bin:$HOME/opt/git-hooks:$PATH"
# We may need to have different paths on different platforms
OS=$(uname)
# Paths for different platforms
case $OS in
Darwin)
VIRTUALENVWRAPPER="/usr/local/share/python/virtualenvwrapper.sh"
BASH_COMPLETION=$(brew --prefix)/etc/bash_completion
LESSPIPE="/usr/local/bin/lesspipe.sh"
CPU_COUNT=$(sysctl hw.ncpu | awk '{print $2}')
LS_ALIAS_FLAGS=''
;;
*)
VIRTUALENVWRAPPER="/usr/local/bin/virtualenvwrapper.sh"
BASH_COMPLETION="/etc/bash_completion"
LESSPIPE="/usr/bin/lesspipe"
CPU_COUNT=$(grep -c processor /proc/cpuinfo)
LS_ALIAS_FLAGS='--color=auto'
;;
esac
# enable programmable completion features
if [ -f $BASH_COMPLETION ] && ! shopt -oq posix; then
. $BASH_COMPLETION
fi
# 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
# Set HISTSIZE and HISTFILESIZE to an empty value as we append and love our history :)
# unset isn't working. It will be reset to 500 everytime!
export HISTSIZE=
export HISTFILESIZE=
# Save history immediatly after running command
# With "history -n" it's possible to read all new lines since last read
PROMPT_COMMAND="history -a"
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# Change behavior of __git_ps1
export GIT_PS1_SHOWDIRTYSTATE=yes
export GIT_PS1_SHOWSTASHSTATE=yes
export GIT_PS1_SHOWUNTRACKEDFILES=yes
# Enable color prompt
if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
# We have color support; assume it's compliant with Ecma-48
# (ISO/IEC-6429). (Lack of such support is extremely rare, and such
# a case would tend to support setf rather than setaf.)
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1)\$ '
else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(__git_ps1)\$ '
fi
# Alias definitions.
if [ -x /usr/bin/dircolors ]; then
test -r $HOME/.dircolors && eval "$(dircolors -b $HOME/.dircolors)" || eval "$(dircolors -b)"
fi
if [ "${LS_ALIAS_FLAGS}" != '' ]; then
alias ls="ls ${LS_ALIAS_FLAGS}"
else
alias ls='ls'
fi
alias dir='dir --color=auto'
alias vdir='vdir --color=auto'
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias df='df -h'
alias ..='cd ..'
alias dual='disper -d auto -t left -e'
alias single='disper -d auto -s'
# virtualenv aliases
# http://blog.doughellmann.com/2010/01/virtualenvwrapper-tips-and-tricks.html
alias v='workon'
alias v.deactivate='deactivate'
alias v.mk='mkvirtualenv'
alias v.mk_withsitepackages='mkvirtualenv --system-site-packages'
alias v.rm='rmvirtualenv'
alias v.switch='workon'
alias v.add2virtualenv='add2virtualenv'
alias v.cdsitepackages='cdsitepackages'
alias v.cd='cdvirtualenv'
alias v.lssitepackages='lssitepackages'
# make less more friendly for non-text input files, see lesspipe(1)
[ -x $LESSPIPE ] && eval "$(SHELL=/bin/sh $LESSPIPE)"
# virtualenvwrapper PROJECT_HOME
export PROJECT_HOME=$HOME/src
# Source virtualenvwrapper, if available
[ -e $VIRTUALENVWRAPPER ] && . $VIRTUALENVWRAPPER
# Set to UTF-8 and english locale
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
# Set to 'C' to make ls sort dotfiles
export LC_COLLATE=C
# Set the right editor
vim="$(which vim)"
if [ -x "${vim}" ]; then
export EDITOR="${vim}"
alias vi=$EDITOR
fi
# Set CONCURRENCY_LEVEL to number of CPUs
export CONCURRENCY_LEVEL=$CPU_COUNT
# Set some Debian variables
DEBEMAIL="me@saz.sh"
DEBFULLNAME="Steffen Zieger"
# Source additional information, which applies to the current host only
[ -f $HOME/.bash_local ] && . ~/.bash_local
export DEBEMAIL DEBFULLNAME
pbuilder-squeeze() {
sudo pbuilder --build $@
}
pbuilder-lenny() {
sudo pbuilder --build --basetgz /var/cache/pbuilder/base-lenny.tgz $@
}
ssh() {
[ "${TERM}" == "screen" ] && printf "\033k$1\033\\"
command ssh "$@"
[ "${TERM}" == "screen" ] && printf "\033k$HOSTNAME\033\\"
}
#if [ "$SHLVL" -lt 2 ]; then
# echo "Hit Ctrl+C to not raise screen now!"
# sleep 1
# screen -D -r
#else
#if [ "$SHLVL" -gt 5 ]; then
# function ssh() {
# hname=${1##*@}
# echo -n -e "\033k$hname\033\\"
# $(which ssh) $@
# echo -n -e "\033k`hostname`\033\\"
# }
# function telnet() {
# echo -n -e "\033k$1\033\\"
# $(which telnet) $@
# echo -n -e "\033k`hostname`\033\\"
# }
# echo -n -e "\033k`hostname`\033\\"
#fi