Skip to content

Commit 325b999

Browse files
committed
✨ feat: updated .bashrc
1 parent 1a13e13 commit 325b999

File tree

1 file changed

+48
-1
lines changed

1 file changed

+48
-1
lines changed

home/.bashrc

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,26 @@ alias mv='mv -i'
99
alias ln='ln -i'
1010
alias rm='rm -i'
1111
alias mkdir='mkdir -p'
12+
alias paths='echo $PATH | tr ":" "\n"'
13+
14+
alias reload='exec $SHELL -l'
1215

1316
mkcd() {
14-
mkdir "$@" && cd "$@"
17+
mkdir "$@" && cd "$@" || exit
1518
}
1619

1720
# gsudo wrapper
1821
sudo() {
1922
WSLENV=WSL_DISTRO_NAME:USER:$WSLENV MSYS_NO_PATHCONV=1 gsudo.exe "$@"
2023
}
2124

25+
# common locations
26+
alias dotf="cd $DOTFILES"
27+
alias docs="cd $USERPROFILE/Documents"
28+
alias desktop="cd $USERPROFILE/Desktop"
29+
alias downloads="cd $USERPROFILE/Downloads"
30+
alias home="cd $USERPROFILE"
31+
2232
# chmod:
2333
# Stolen from: - https://github.com/ohmybash/oh-my-bash/blob/master/aliases/chmod.aliases.sh
2434
alias perm='stat --printf "%a %n \n "' # Show permission of target in number
@@ -34,6 +44,38 @@ alias ux='chmod u+x' # ---x------ (user: --x, group: -, other:
3444
alias g='git'
3545
\. /mingw64/share/git/completion/git-completion.bash
3646

47+
if command -v lazygit >/dev/null 2>&1; then
48+
alias lg='lazygit'
49+
fi
50+
51+
# oh-my-posh
52+
if command -v oh-my-posh >/dev/null 2>&1; then
53+
alias omp='oh-my-posh'
54+
source <(oh-my-posh completion bash)
55+
eval "$(oh-my-posh init bash --config $DOTFILES/home/bash-zen.toml)"
56+
fi
57+
58+
if command -v eza >/dev/null 2>&1; then
59+
alias ls='eza --git --icons --group --group-directories-first --time-style=long-iso --color-scale=all'
60+
alias l='ls --git-ignore'
61+
alias ll='ls --all --header --long'
62+
alias lm='ls --all --header --long --sort=modified'
63+
alias la='ls -lbhHigUmuSa'
64+
alias lx='ls -lbhHigUmuSa@'
65+
alias lt='eza --all --icons --group --group-directories-first --tree --color-scale=all'
66+
alias tree='ls --tree'
67+
else
68+
alias dir='ls -hFx'
69+
alias ls='ls --color=auto'
70+
alias l='ls -CF'
71+
alias lm='ls -al | more'
72+
alias ll='ls -lAFh'
73+
alias la='ls -Al'
74+
75+
# lr: Full Recursive Directory Listing
76+
alias lr='ls -R | grep ":$" | sed -e '\''s/:$//'\'' -e '\''s/[^-][^\/]*\//--/g'\'' -e '\''s/^/ /'\'' -e '\''s/-/|/'\'' | less'
77+
fi
78+
3779
# docker
3880
if command -v docker >/dev/null 2>&1; then
3981
alias d='docker'
@@ -50,3 +92,8 @@ fi
5092
if command -v pip >/dev/null 2>&1; then
5193
source <(pip completion --bash)
5294
fi
95+
96+
# zoxide
97+
if command -v zoxide >/dev/null 2>&1; then
98+
eval "$(zoxide init bash --cmd cd)"
99+
fi

0 commit comments

Comments
 (0)