-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc_global
132 lines (110 loc) · 2.76 KB
/
.bashrc_global
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
#.bashrc
export EDITOR=vim
# system bashrc
if [ -f /etc/bashrc ]; then
# . /etc/bashrc
fi
# default bashrc
if [ -f $HOME/.bashrc_default ]; then
. $HOME/.bashrc_default
fi
# local bashrc
if [ -f $HOME/.bashrc_local ]; then
. $HOME/.bashrc_local
fi
# PATH
export PATH="/usr/local/bin:$PATH"
export PATH="$HOME/local/bin:$HOME/usr/local/bin:$PATH"
export DEV_TOOL_HOME="$HOME/repositories"
# homebrew
eval "$(/opt/homebrew/bin/brew shellenv)"
# General alias
alias diff="colordiff"
alias grep="grep --color"
alias ll="ls -lhAG"
alias vdiff="vimdiff"
alias resource="source $HOME/.bash_profile"
alias ssh="ssh -o ServerAliveInterval=60"
# Document
export DOCUMENT_ROOT="$HOME/Documents/daynotes"
alias daynote='vim $DOCUMENT_ROOT/`date "+%Y%m%d".md`'
alias daynotes="find $DOCUMENT_ROOT -maxdepth 1 -type f | grep '\d\d\d\d\d\d\d\d.md$' | sort -r | xargs cat | view -"
le () {
TMPFLE=`mktemp`
vim $TMPFLE
if type pbcopy > /dev/null 2>&1; then
cat $TMPFLE | pbcopy
fi
cat $TMPFLE
rm $TMPFLE
unset TMPFLE
}
# Git
export GIT_HOME=$DEV_TOOL_HOME/git
export PATH=$GIT_HOME/contrib/diff-highlight:$PATH
# Git alias
alias g="git"
alias ga="git add"
alias gap="git add -p"
alias gc="git commit"
alias gca="git commit --amend"
alias gcv="git commit -v"
alias gcva="git commit -v --amend"
alias gac="git add . && git commit -v"
alias gd="git diff"
alias gs="git status --branch --short"
alias gco="git checkout"
alias gbv="git branch --list -vv"
alias gpo="git push origin"
alias gpu="git push upstream"
# Git config
if [ -f $GIT_HOME/contrib/completion/git-completion.zsh ]
then
fpath=($GIT_HOME/contrib/completion/git-completion.zsh $fpath)
fi
# Bundler aliases
alias be="bundle exec"
alias bi="bundle install"
# Docker aliases
alias dc="docker-compose"
# Perlbrew
if [ -f $HOME/perl5/perlbrew/etc/bashrc ]
then
source $HOME/perl5/perlbrew/etc/bashrc
fi
# Android
export PATH="$PATH:$DEV_TOOL_HOME/eclipse:$DEV_TOOL_HOME/sdk/tools:$DEV_TOOL_HOME/sdk/platform-tools"
export ANDROID_HOME="$HOME/Development/sdk"
# anyenv
export PATH="$HOME/.anyenv/bin:$PATH"
eval "$(anyenv init -)"
# rbenv
if [ -d $HOME/.rbenv ]; then
export PATH=$HOME/.rbenv/bin:$PATH
eval "$(rbenv init -)"
fi
# Java
export JAVA_OPTS="-Dfile.encoding=UTF-8"
# Scala
export SCALA_HOME=$HOME/local/share/scala
export PATH=$SCALA_HOME/bin:$PATH
# Play Framework
export PATH=$DEV_TOOL_HOME/play:$PATH
export PATH=$DEV_TOOL_HOME/activator:$PATH
# Go
export GOPATH="$HOME/.go"
export PATH="$GOROOT/bin:$GOPATH/bin:$PATH"
# GHQ
alias r='cd $(ghq list -p | peco)'
# Other
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export MANPATH=/opt/local/man:$MANPATH
# Tool
le() {
EE_TMPFILE=`mktemp`
vim $EE_TMPFILE
cat $EE_TMPFILE | pbcopy
rm $EE_TMPFILE
unset EE_TMPFILE
}
autoload -Uz compinit && compinit -i