-
Notifications
You must be signed in to change notification settings - Fork 1
/
.bashrc
125 lines (104 loc) · 2.95 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
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
# ~/.bashrc: executed by bash(1) for non-login shells.
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
alias files='cut -d: -f1 | uniq'
alias d='docker'
alias dc='docker-compose'
alias dm='docker-machine'
alias ls='ls -ahF'
alias :e="nvim"
alias :v="tmux split-window -h nvim"
alias :s="tmux split-window -v nvim"
tnjq() {
jq -r .msg | jq -r '.log|rtrimstr("\n")' | jq "$@"
}
PSCOLOR=$(if [ "$USER" == "root" ]; then echo -n 31; else echo -n 33; fi)
PS1='\[\033[01;34m\]''\W '"\[\033[1;${PSCOLOR}m\]❯\[\033[00;37m\] "
if [ "$(uname -a | grep Microsoft)" != "" ]; then
export PS1='\[\033[01;34m\]''\W '"\[\033[1;${PSCOLOR}m\]>\[\033[00;37m\] "
fi
function ran() {
man -k . | awk '
BEGIN {srand()}
{
cur = substr($1, 0, index($1, "(")-1);
score = rand();
if (score > last_score) {
last_score = score;
last = cur;
}
}
END {print last}
' | xargs man
}
git-repush() {
git br -D "$1" &&
git br "$1" &&
git push origin "$1" -f
}
export EDITOR=vim
export PAGER=less
export LESS="-SMRci"
export GOPATH="${HOME}"/gocode
export CPLUS_INCLUDE_PATH="/usr/local/include:${CPLUS_INCLUDE_PATH}"
export PATH=\
/sbin:\
/bin:\
${GOPATH}/bin:\
/usr/local/sbin:\
/usr/local/bin:\
/usr/sbin:\
/usr/bin:\
/Developer/usr/bin:\
${HOME}/bin:\
${HOME}/FlameGraph:\
${HOME}/.yarn/bin:\
/Applications/Inkscape.app/Contents/Resources/bin:\
/usr/local/opt/go/libexec/bin
# git bash completion
if [ -f /usr/local/etc/bash_completion.d/git-completion.bash ]; then
source /usr/local/etc/bash_completion.d/git-completion.bash
elif [ -f /usr/local/share/git-core/git-completion.bash ]; then
source /usr/local/share/git-core/git-completion.bash
fi
# brew completion
if which brew > /dev/null && [ -f "$(brew --prefix)/etc/bash_completion" ]; then
source "$(brew --prefix)/etc/bash_completion"
fi
# added by travis gem
if [ -f "$HOME"/.travis/travis.sh ]; then
source "$HOME"/.travis/travis.sh
fi
# added by nvm
export NVM_DIR="$HOME/.nvm"
if [ -s "$NVM_DIR/nvm.sh" ]; then
source "$NVM_DIR/nvm.sh"
fi
# local overrides
if [ -f "$HOME"/.bashrc.local ]; then
source "$HOME"/.bashrc.local
fi
# if which nvim > /dev/null; then
# alias vim='nvim'
# fi
setup-fasd() {
if which fasd > /dev/null; then
fasd_cache="$HOME/.fasd-init-bash"
if [ "$(command -v fasd)" -nt "$fasd_cache" ] || [ ! -s "$fasd_cache" ]; then
fasd --init posix-alias bash-hook bash-ccomp bash-ccomp-install >| "$fasd_cache"
fi
source "$fasd_cache"
unset fasd_cache
fi
}
z() {
unset z
setup-fasd
fasd_cd -d "$@"
}
export GO15VENDOREXPERIMENT=1
# added by travis gem
[ -f /Users/kris/.travis/travis.sh ] && source /Users/kris/.travis/travis.sh
# d=$(test -f /tmp/wat.txt && cat /tmp/wat.txt || echo 0.1)
# (sleep "$d" && echo "$d + 0.1") | bc > /tmp/wat.txt