This repository has been archived by the owner on Feb 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
129 lines (109 loc) · 2.91 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
126
127
128
alias ls="ls --color=auto"
alias vi="nvim"
alias vim="nvim"
alias g="git"
alias tmux="tmux -u"
export GOPATH="$HOME/.go"
export GOBIN="$GOPATH/bin"
export CLOUDSDK_PYTHON=python2
export EDITOR=nvim
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk
export PATH="$PATH:$HOME/.local/bin:$HOME/.deno/bin:/usr/local/go/bin:$HOME/.go/bin:$HOME/.anyenv/bin:$HOME/.anyenv/versions/2.6.8/bin:$HOME/.anyenv/envs/nodenv/bin:$HOME/.cargo/bin:/usr/lib/jvm/default/bin:$HOME/.google-cloud-sdk/bin:$HOME/.gsutil/gsutil/:$GOBIN"
export NIX_REMOTE=daemon
#export JAVA_HOME=/usr/lib/jvm/java-11-openjdk
export GIT_PS1_SHOWDIRTYSTATE=1
if [ -x "`which anyenv`" ]; then
export ANYENV_ROOT="$HOME/.anyenv"
eval "$(anyenv init -)"
fi
if [ -x `which nodenv` ]; then
export PATH="$PATH:$(npm bin -g)"
fi
source "$HOME/.git-completion.bash"
source "$HOME/.git-prompt.sh"
set -o vi
prompt() {
local GITPS='$(__git_ps1 "[%s]")'
local BLUE="\[\e[1;34m\]"
local RED="\[\e[1;31m\]"
local GREEN="\[\e[2;32m\]"
local WHITE="\[\e[00m\]"
local GRAY="\[\e[1;37m\]"
local RESET="\[\e[0m\]"
PS1=" $RED\u$WHITE@\h$RESET $GRAY\w$RESET $RED$GITPS\n\[\e[0m\]$ $WHITE "
}
prompt
clear-panes() {
for _pane in $(tmux list-panes -F '#P'); do
tmux send-keys -t ${_pane}
done
}
dev() {
if [ $# != 0 ]; then
cd "$HOME/Works/$1"
fi
tmux split-window -h -p 24
tmux split-window -v -p 75
tmux split-window -v -p 66
tmux split-window -v -p 50
#tmux split-window -h -p 50
tmux select-pane -L
clear-panes
tmux rename-window "$1"
}
deh() {
if [ $# != 0 ]; then
cd "$HOME/Works/$1"
fi
tmux split-window -v -p 30
tmux split-window -h -p 66
tmux split-window -h -p 50
#tmux split-window -h -p 50
tmux select-pane -L
clear-panes
tmux rename-window "$1"
}
_dev() {
local cur prev cword
_get_comp_words_by_ref -n : cur prev cword
if [ "$(uname)" == "Darwin" ]; then
COMPREPLY=( $(compgen -W "$(ls "$HOME/Works")" -- "${cur}") )
else
COMPREPLY=( $(compgen -W "$(ls -N "$HOME/Works")" -- "${cur}") )
fi
}
complete -F _dev dev
complete -F _dev deh
lab() {
if [ $# != 0]; then
cd "$HOME/Labo/"
fi
tmux split-window -v -p 30
tmux select-pane -U
clear-pane
}
complete -F _dev lab
wcd() {
cd "$HOME/Works/$1"
}
complete -F _dev wcd
if [ -x "`which direnv`" ]; then
eval "$(direnv hook bash)"
fi
if [ -f $HOME/.cargo/env ]; then
source "$HOME/.cargo/env"
fi
if [ -f /usr/share/jenv-git/init-jenv ]; then
source /usr/share/jenv-git/init-jenv.sh
fi
if [ -f $HOME/.profile ]; then
source $HOME/.profile
fi
alias .="cd .. && pushd ."
alias ..="cd ../.. && pushd ."
alias ...="cd ../../.. && pushd ."
alias ....="cd ../../../.. && pushd ."
alias .....="cd ../../../../.. && pushd ."
alias ......="cd ../../../../../.. && pushd ."
alias .......="cd ../../../../../../.. && pushd ."
alias ,,="popd"