-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_bashrc
314 lines (238 loc) · 8.33 KB
/
dot_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
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# .bashrc
echo "This is cubrid@dhkim216 bash shell"
echo $PATH | tr ':' '\n'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# tab completion
# If there are multiple matches for completion, Tab should cycle through them
bind 'TAB:menu-complete'
# And Shift-Tab should cycle backwards
bind '"\e[Z": menu-complete-backward'
# Display a list of the matching files
bind "set show-all-if-ambiguous on"
# Perform partial (common) completion on the first Tab press, only start
# cycling full results on the second Tab press (from bash version 5)
bind "set menu-complete-display-prefix on"
# User specific aliases and functions
source ~/.custom_profile
export CUBRID=$HOME/CUBRID
export CUBRID_DATABASES=$CUBRID/databases
export PATH=$CUBRID/bin:$PATH
export LD_LIBRARY_PATH=$CUBRID/lib:$CUBRID/cci/lib:$LD_LIBRARY_PATH
# DHKIM
# -----
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
export EDITOR='nvim'
export TERM=xterm
export PATH="$PATH:/opt/nvim-linux64/bin"
export PATH="$HOME/.local/bin:$PATH"
# Config profiles
alias profile="$EDITOR ~/.bashrc"
## bashrc
alias bashrc="$EDITOR ~/.bashrc"
alias bashconfig="$EDITOR ~/.bashrc"
alias bashprofile="$EDITOR ~/.bashrc"
## zshrc
alias zshrc="$EDITOR ~/.zshrc"
alias zshconfig="$EDITOR ~/.zshrc"
alias zshprofile="$EDITOR ~/.zshrc"
## nvimrc
alias nvimrc="$EDITOR ~/.config/nvim/init.lua"
alias nvimprofile="$EDITOR ~/.config/nvim/init.vim"
## vimrc
alias vimrc="$EDITOR ~/.vimrc"
alias vimprofile="$EDITOR ~/.vimrc"
# System aliases
if [ -x "$(command -v exa)" ]; then
alias ls='exa -aF'
alias l='exa -aF'
alias la='exa -laF'
alias ll='exa -laF'
alias lsd='exa -laF --only-dirs'
else
alias ls='ls -aF'
alias l='ls -AF'
alias la=' -lAF'
alias ll='ls -lAF'
alias lsd='ls -lAF --color=auto --group-directories-first | grep --color=never "^d"'
fi
alias which="which -a"
which-alias() {
alias | grep "^$1"
}
alias du='dust'
## Safety Features
alias cp='cp -i' # confirm before overwriting something
alias mv='mv -i' # confirm before overwriting something
## utility aliases
mc() {
mkdir $@
cd $@
}
## Navigation aliases
function cl() {
builtin cd "$@" && ls
}
alias cd='cl'
alias c='cd'
alias cz='DIR=$(zoxide query -l | fzf) && [[ -n $DIR ]] && cd "$DIR"'
alias cx='DIR=$(fdfind --type d | fzf) && [[ -n $DIR ]] && cd "$DIR"'
alias cf='cd "$(fdfind . --type f | fzf --height 40% --reverse | xargs -I {} dirname {})"'
alias up='cd ..' # Move up one directory
alias back='cd -$OLDPWD' # Return to the previous directory
alias pr='cd $(git rev-parse --show-toplevel || echo ".")' # go to git root directory
alias pcd='cd $(git rev-parse --show-toplevel || echo ".")' # go to git root directory
alias gr='cd $(git rev-parse --show-toplevel || echo ".")' # go to git root directory
alias gcd='cd $(git rev-parse --show-toplevel || echo ".")' # go to git root directory
function gcx() {
local gitRoot=$(git rev-parse --show-toplevel 2>/dev/null || echo ".")
cd "$gitRoot" || return
local DIR=$(fdfind --type d . | fzf) && [[ -n $DIR ]] && cd "$DIR"
}
## Networking and System Information
alias ports='netstat -tulanp'
alias ipinfo='curl ipinfo.io' # Quick IP address and network info
alias myip='curl http://ipecho.net/plain echo' # External IP address
# Git Aliases
alias ga='git add'
alias gc='git commit'
alias gcm='git commit -m'
## git diff
alias gd='git diff'
alias gds='git diff --staged'
alias gdc='git diff --cached'
## git log
alias gg='git-graph'
alias gl='git log --graph --pretty=format:"%C(auto)%h %an%d%n%w(0,4,4)%<(50,trunc)%s" --all'
alias gloga='git log --oneline --all --graph --decorate'
## git pull
alias gpl='git pull'
alias gpom='git pull origin main'
## git push
alias gfp='git fetch --prune'
alias gp='git push'
alias gps='git push'
alias gpsoh='git push origin HEAD'
alias gpoh='git push origin HEAD'
## git status
alias gs='git status'
alias gst='git status'
## git switch
alias gb='git branch'
alias gsw='git switch'
alias gco='git checkout'
## git etc
alias gcz="~/.local/bin/cz"
alias gfz="git fuzzy"
# Deveplopment and Programming aliases
alias nv='nvim'
alias v='nvim'
## tmux
alias tm='tmux a || tmux'
## python
alias py='python3'
## docker
alias doc='docker' # Never use do. It is part of zsh shell grammar.
alias dc='docker compose'
alias dco='docker compose'
alias dcu='docker compose up'
alias dcub='docker compose up --build'
alias dcd='docker compose down'
alias dcr='docker compose run'
alias dcb='docker compose build'
alias dcl='docker compose logs'
# wsl aliases
alias ws="webstorm64.exe"
alias ii="explorer.exe"
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
## zoxide
eval "$(zoxide init bash)"
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return ;;
esac
# bash-it
# Path to the bash it configuration
export BASH_IT="/home/cubrid/.bash_it"
# Lock and Load a custom theme file.
# Leave empty to disable theming.
# location /.bash_it/themes/
# export BASH_IT_THEME='bobby'
# Some themes can show whether `sudo` has a current token or not.
# Set `$THEME_CHECK_SUDO` to `true` to check every prompt:
#THEME_CHECK_SUDO='true'
# (Advanced): Change this to the name of your remote repo if you
# cloned bash-it with a remote other than origin such as `bash-it`.
# export BASH_IT_REMOTE='bash-it'
# (Advanced): Change this to the name of the main development branch if
# you renamed it or if it was changed for some reason
# export BASH_IT_DEVELOPMENT_BRANCH='master'
# Your place for hosting Git repos. I use this for private repos.
export GIT_HOSTING='[email protected]'
# Don't check mail when opening terminal.
unset MAILCHECK
# Change this to your console based IRC client of choice.
export IRC_CLIENT='irssi'
# Set this to the command you use for todo.txt-cli
export TODO="t"
# Set this to the location of your work or project folders
#BASH_IT_PROJECT_PATHS="${HOME}/Projects:/Volumes/work/src"
# Set this to false to turn off version control status checking within the prompt for all themes
export SCM_CHECK=true
# Set to actual location of gitstatus directory if installed
#export SCM_GIT_GITSTATUS_DIR="$HOME/gitstatus"
# per default gitstatus uses 2 times as many threads as CPU cores, you can change this here if you must
#export GITSTATUS_NUM_THREADS=8
# Set Xterm/screen/Tmux title with only a short hostname.
# Uncomment this (or set SHORT_HOSTNAME to something else),
# Will otherwise fall back on $HOSTNAME.
#export SHORT_HOSTNAME=$(hostname -s)
# Set Xterm/screen/Tmux title with only a short username.
# Uncomment this (or set SHORT_USER to something else),
# Will otherwise fall back on $USER.
#export SHORT_USER=${USER:0:8}
# If your theme use command duration, uncomment this to
# enable display of last command duration.
#export BASH_IT_COMMAND_DURATION=true
# You can choose the minimum time in seconds before
# command duration is displayed.
#export COMMAND_DURATION_MIN_SECONDS=1
# Set Xterm/screen/Tmux title with shortened command and directory.
# Uncomment this to set.
#export SHORT_TERM_LINE=true
# Set vcprompt executable path for scm advance info in prompt (demula theme)
# https://github.com/djl/vcprompt
#export VCPROMPT_EXECUTABLE=~/.vcprompt/bin/vcprompt
# (Advanced): Uncomment this to make Bash-it reload itself automatically
# after enabling or disabling aliases, plugins, and completions.
# export BASH_IT_AUTOMATIC_RELOAD_AFTER_CONFIG_CHANGE=1
# Uncomment this to make Bash-it create alias reload.
# export BASH_IT_RELOAD_LEGACY=1
# Load Bash It
source "$BASH_IT"/bash_it.sh
# bash-it end ---
# pyenv
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
# user alias
alias c='cd'
alias b='~/github/vimkim/cubrid/build.sh -m debug -p $HOME/CUBRID -g ninja -t 64 build'
alias oc='code -r ~/github/vimkim/cubrid'
# starship
eval "$(starship init bash)"
# curl for centos7
export PATH=$HOME/curl/bin:$PATH
export HOMEBREW_CURL_PATH=$(which curl)
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
. "$HOME/.cargo/env"
. "$HOME/.atuin/bin/env"
[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh
eval "$(atuin init bash)"