-
Notifications
You must be signed in to change notification settings - Fork 2
/
.common.shellrc
155 lines (124 loc) · 3.25 KB
/
.common.shellrc
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
#!/usr/bin/env bash
# base
export LC_CTYPE=en_US.UTF-8
export LANG=en_US.UTF-8
export EDITOR="nvim"
export SVDIR=~/service
export TERM=screen-256color # xterm-256color
# colours
blu=$(printf "\033\\[1;34m")
clr=$(printf "\033\\[m")
grn=$(printf "\033\\[32m")
gry=$(printf "\033\\[37m")
mag=$(printf "\033\\[35m")
red=$(printf "\033\\[31m")
export blu clr grn gry mag red
# gnu tools
if which gls > /dev/null; then alias ls=gls; fi
if which gdircolors > /dev/null; then alias dircolors=gdircolors; fi
# turn off xon/xoff to avoid conflict with CTRL-s readline forward search
stty -ixon
# aliases
alias ....="cd ../../.."
alias ...="cd ../.."
alias ..="cd .."
alias clear="echo use CTRL-L instead. && false"
alias e='emacs -nw'
alias gist='gist -p'
alias gst='git status'
alias gti='git'
alias i='irssi-customized'
alias l='ls --color -alFh'
alias less='less -R' # interpret color
alias ll='ls --color -bF'
alias m='mutt'
alias nhn="sudo ipfw add 70000 deny tcp from any to news.ycombinator.com"
alias potoday='2>/dev/null cat $(plog) | grep completed\. | wc -l'
alias pwdc="pwd | pbcopy"
alias s='soywiki'
alias tree='tree -C' # color
alias v='vim .'
alias vi='vim'
alias vim='nvim'
alias ytop="ytop -c monokai"
alias k="kubectl"
# base
export PATH=~/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
# mode
export FOCUS=${FOCUS:-s}
alias work='source solarized --theme light && FOCUS=s t'
alias fun='source solarized --theme dark && FOCUS=b t'
# other
export SOYWIKI_VIM="nvim"
# only run once on login shell. allows tmux reconfigurations
source solarized --theme light --skip-if-configured
# cabal
export PATH=$PATH:~/.cabal/bin
# conscript
export PATH=$PATH:~/.conscript/bin
# flutter
export PATH=~/src/github.com/flutter/flutter/bin:$PATH
# work
if [[ $FOCUS -eq 's' ]]; then
export PATH=$PATH:~/.work/bin
git config --global user.email "rany@reflectionlabs.com"
fi
# play
if [[ $FOCUS -eq 'b' ]]; then
git config --global user.email "purzelrakete@gmail.com"
fi
# osx
uname -a | grep "^Darwin" >/dev/null && source ~/.osx
# linux
uname -a | grep "^Linux" >/dev/null && source ~/.linux
# go
export PATH=$PATH:/usr/local/go/bin
export GOPATH=~
export PATH=$PATH:$GOPATH/bin
# openssl
export PATH="/usr/local/opt/openssl/bin:$PATH"
# extension point
for ext in ~/.common/*; do
source "$ext"
done
# python
export PATH=~/.local/bin:$PATH
# conda
export PATH=$PATH:~/anaconda3/bin
# rbenv
export PATH="$HOME/.rbenv/bin:$PATH"
if which rbenv > /dev/null; then
eval "$(rbenv init -)"
fi
# flutter
export PATH=/usr/local/flutter/bin:$PATH
# ripgrep
function rg() {
command rg -p "$@" | less -R
}
# fix ssh agent
function fixsshagent() {
for s in $(ps e | sed -n 's/.*SSH_AUTH_SOCK=\([^ ]*\) .*/\1/p' | sort -u)
do
if [ -S $s ]
then
export SSH_AUTH_SOCK=$s
fi
done
}
# fzf
export FZF_DEFAULT_COMMAND='rg --files'
if [[ $SOLARIZED_MODE == 'dark' ]]; then
export FZF_COLORS="
--color fg:-1,bg:-1,hl:33,fg+:254,bg+:-1,hl+:33
--color info:136,prompt:136,pointer:230,marker:230,spinner:136
"
fi
if [[ $SOLARIZED_MODE == 'light' ]]; then
export FZF_COLORS="
--color fg:-1,bg:-1,hl:33,fg+:254,bg+:-1,hl+:33
--color info:136,prompt:136,pointer:230,marker:230,spinner:136
"
fi
export FZF_DEFAULT_OPTS="$FZF_COLORS -m --height 50%"
welcome