Skip to content

Commit d9be082

Browse files
committed
♻️ refactor: cleanup .bashrc & .bash_profile
1 parent 8b81a1c commit d9be082

File tree

2 files changed

+30
-20
lines changed

2 files changed

+30
-20
lines changed

home/.bash_profile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
11
# generated by Git for Windows
22
test -f ~/.profile && . ~/.profile
33
test -f ~/.bashrc && . ~/.bashrc
4-
5-
export DOTFILES="$(dirname $(dirname $(readlink ~/.bash_profile)))"
6-
7-
test -f ~/.config/bash/.bash_aliases && . ~/.config/bash/.bash_aliases
8-
test -f ~/.config/bash/.bash_completions && . ~/.config/bash/.bash_completions

home/.bashrc

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,42 @@
1+
# cSpell:disable
2+
13
export DOTFILES="$(dirname $(dirname $(readlink ~/.bashrc)))"
24

3-
# gsudo wrapper
4-
function sudo() {
5-
WSLENV=WSL_DISTRO_NAME:USER:$WSLENV MSYS_NO_PATHCONV=1 gsudo.exe "$@"
6-
}
5+
# Source external files
6+
test -f ~/.config/bash/.bash_env && . ~/.config/bash/.bash_env
7+
test -f ~/.config/bash/.bash_aliases && . ~/.config/bash/.bash_aliases
8+
test -f ~/.config/bash/.bash_completions && . ~/.config/bash/.bash_completions
9+
test -f ~/.config/bash/.bash_functions && . ~/.config/bash/.bash_functions
10+
11+
# Bash shell settings
12+
shopt -s autocd
13+
shopt -s cdspell
14+
shopt -s checkwinsize
15+
shopt -s direxpand dirspell
16+
shopt -s extglob
17+
shopt -s globstar
18+
shopt -s no_empty_cmd_completion
19+
shopt -s nocaseglob
20+
21+
# History
22+
HISTCONTROL=ignoreboth:erasedups
23+
HISTIGNORE="&:[bf]g:c:clear:history:exit:q:pwd:* --help"
24+
HISTFILESIZE=10000
25+
HISTSIZE=10000
26+
shopt -s cmdhist
27+
shopt -s histappend histverify
728

829
# oh-my-posh
930
if command -v oh-my-posh >/dev/null 2>&1; then
10-
alias omp='oh-my-posh'
1131
eval "$(oh-my-posh init bash --config $DOTFILES/home/bash-zen.toml)"
1232
fi
1333

14-
# yazi
15-
function y() {
16-
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
17-
yazi "$@" --cwd-file="$tmp"
18-
if cwd="$(command cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then
19-
builtin cd -- "$cwd"
20-
fi
21-
rm -f -- "$tmp"
22-
}
23-
2434
# zoxide
2535
if command -v zoxide >/dev/null 2>&1; then
2636
eval "$(zoxide init bash --cmd cd)"
2737
fi
38+
39+
# fastfetch
40+
if command -v fastfetch >/dev/null 2>&1; then
41+
fastfetch
42+
fi

0 commit comments

Comments
 (0)