Switch to proper if statements.

This commit is contained in:
Bartek Stalewski 2023-05-03 01:34:27 +02:00
parent a94de99041
commit e58497ec55
3 changed files with 42 additions and 12 deletions

View file

@ -3,8 +3,11 @@ alias gae='git add .; git commit --amend; git push --force-with-lease'
alias less='less -R'
alias startx='xinit ~/.config/xinitrc -- /etc/X11/xinit/xserverrc :0 -ardelay 280 -arinterval 30'
[ $(command -v bat) ] && alias cat='bat -pp --color=always --tabs=2 --theme=Monokai\ Extended\ Bright'
if [ $(command -v exa) ]; then
if [[ $(command -v bat) ]]; then
alias cat='bat -pp --color=always --tabs=2 --theme=Monokai\ Extended\ Bright'
fi
if [[ $(command -v exa) ]]; then
alias ls='exa --group-directories-first'
alias ll='ls -l --git --octal-permissions --no-permissions'
else
@ -14,9 +17,15 @@ else
esac
alias ll='ls -l'
fi
if [ $(command -v fd) ]; then
[ -f ~/.local/config/fd ] && alias fd='fd -H -L --ignore-file ~/.local/config/fd' || alias fd='fd -H -L'
if [[ $(command -v fd) ]]; then
if [[ -f ~/.local/config/fd ]]; then
alias fd='fd -H -L --ignore-file ~/.local/config/fd'
else
alias fd='fd -H -L'
fi
fi
if [ $(command -v nvim) ]; then
export EDITOR=nvim
export MANPAGER="nvim +Man!"
@ -27,7 +36,12 @@ elif [ $(command -v vim) ] ; then
else
export EDITOR=vi
fi
[ $(command -v rg) ] && alias grep='rg -i' || alias grep='grep --color'
if [[ $(command -v rg) ]]; then
alias grep='rg -i'
else
alias grep='grep --color'
fi
function ud() {
wd dots && git pull