forked from babymastodon/rc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbashrc_extra
48 lines (40 loc) · 1.26 KB
/
bashrc_extra
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
# command prompt shows git branch
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
NO_COLOUR="\[\033[0m\]"
PS1="$GREEN\u@\h$NO_COLOUR:\w$YELLOW\$(parse_git_branch)$NO_COLOUR\$ "
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
# store the ssh auth sock in the home folder for access from tmux
if [ ! -z "$SSH_AUTH_SOCK" -a "$SSH_AUTH_SOCK" != "$HOME/.ssh/agent_sock" ] ; then
unlink "$HOME/.ssh/agent_sock" 2>/dev/null
ln -s "$SSH_AUTH_SOCK" "$HOME/.ssh/agent_sock"
export SSH_AUTH_SOCK="$HOME/.ssh/agent_sock"
fi
# aliases for tmux
export TMUXTMP=~/.tmuxtmp
mkdir -p $TMUXTMP
alias newmoo="TMPDIR=$TMUXTMP tmux new -s moo"
alias moo="TMPDIR=$TMUXTMP tmux attach -dt moo"
alias fixmoo='TMPDIR=$TMUXTMP killall -s SIGUSR1 tmux'
alias vimdiff='vim -d'
alias ck='git checkout'
alias cm='git commit'
alias pl='git pull'
alias ph='git push'
# enable bash completion
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
# enable git autocompletion
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
# disable scroll lock
stty -ixon