-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_bashrc
More file actions
353 lines (281 loc) · 9.39 KB
/
Copy pathdot_bashrc
File metadata and controls
353 lines (281 loc) · 9.39 KB
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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# .bashrc
path_prepend() {
local dir
for dir in "$@"; do
[ -d "$dir" ] || continue
case ":$PATH:" in
*":$dir:"*) ;;
*) PATH="$dir:$PATH" ;;
esac
done
export PATH
}
export EDITOR='nvim'
export HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew"
export HOMEBREW_CELLAR="/home/linuxbrew/.linuxbrew/Cellar"
export HOMEBREW_REPOSITORY="/home/linuxbrew/.linuxbrew/Homebrew"
[ -z "${MANPATH-}" ] || export MANPATH=":${MANPATH#:}"
export INFOPATH="$HOMEBREW_PREFIX/share/info:${INFOPATH:-}"
path_prepend \
"/opt/nvim-linux64/bin" \
"$HOMEBREW_PREFIX/sbin" \
"$HOMEBREW_PREFIX/bin" \
"$HOME/.local/bin" \
"$HOME/.cargo/bin"
# If not running interactively, don't do anything else.
case $- in
*i*) ;;
*) return ;;
esac
# Agent-style `bash -i -c ...` shells get PATH/env, not prompt/history UI.
if [[ -z ${BASH_FULL_INIT:-} && ( ! -t 0 || ! -t 1 ) ]]; then
return
fi
# Source global definitions for human Bash sessions.
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
alias chez='chezmoi'
alias chezd='cd ~/.local/share/chezmoi/'
# 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
# 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
# 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 command -v eza >/dev/null 2>&1; then
alias ls='eza -aF'
alias l='eza -aF'
alias la='eza -laF'
alias ll='eza -laF'
alias lsd='eza -laF --only-dirs'
else
alias ls='ls -aF'
alias l='ls -AF'
alias la='ls -lAF'
alias ll='ls -lAF'
alias lsd='ls -lAF --color=auto --group-directories-first | grep --color=never "^d"'
fi
alias which="which -a"
if command -v dust >/dev/null 2>&1; then
alias du='dust'
fi
## Safety Features
alias cp='cp -i' # confirm before overwriting something
alias mv='mv -i' # confirm before overwriting something
## utility aliases
mc() {
[ "$#" -eq 1 ] || return 2
mkdir -p -- "$1" && cd -- "$1"
}
## Navigation aliases
function cl() {
builtin cd "$@" && ls
}
alias cd='cl'
alias c='cd'
alias up='cd ..' # Move up one directory
alias back='cd -' # 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
if command -v fd >/dev/null 2>&1; then
_fd_cmd=fd
elif command -v fdfind >/dev/null 2>&1; then
_fd_cmd=fdfind
fi
if command -v fzf >/dev/null 2>&1; then
cz() {
command -v zoxide >/dev/null 2>&1 || return 127
local dir
dir=$(zoxide query -l | fzf) && [[ -n $dir ]] && cd "$dir"
}
if [[ -n ${_fd_cmd:-} ]]; then
# cx() {
# local dir
# dir=$("$_fd_cmd" --type d | fzf) && [[ -n $dir ]] && cd "$dir"
# }
cf() {
local file
file=$("$_fd_cmd" . --type f | fzf --height 40% --reverse) && [[ -n $file ]] && cd "$(dirname -- "$file")"
}
fi
fi
alias ai='claude --dangerously-skip-permissions'
alias aip='ai "read prompt.md and execute"'
alias cx='codex'
alias cxp='codex "read prompt.md and execute"'
function gcx() {
local gitRoot=$(git rev-parse --show-toplevel 2>/dev/null || echo ".")
cd "$gitRoot" || return
[[ -n ${_fd_cmd:-} ]] || return 127
command -v fzf >/dev/null 2>&1 || return 127
local dir
dir=$("$_fd_cmd" --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 ncb='just cb'
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"
if command -v zoxide >/dev/null 2>&1; then
eval "$(zoxide init bash)"
fi
# 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='git@git.domain.com'
# 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
# user alias
alias c='cd'
alias lz='lazygit'
alias v='nvim'
if command -v nu >/dev/null 2>&1; then
alias za='SHELL=nu zellij'
else
alias za='zellij'
fi
case "$(tty 2>/dev/null)" in
/dev/tty[0-9]*)
export STARSHIP_CONFIG="$HOME/.config/starship-console.toml"
;;
esac
if command -v starship >/dev/null 2>&1; then
eval "$(starship init bash)"
fi
if command -v atuin >/dev/null 2>&1; then
eval "$(atuin init bash)"
fi
. "$HOME/.cargo/env"