ENH only make aliases when binaries exists

This commit is contained in:
Nathan Dwarshuis 2021-06-12 15:47:54 -04:00
parent 80d75659e9
commit bb4d796ebe
1 changed files with 44 additions and 34 deletions

View File

@ -192,11 +192,17 @@ precmd () { echo -ne "\033]0;urxvt: ${PWD}\007" }
alias als='alias | grep' alias als='alias | grep'
alias hs='history 1 | grep' alias hs='history 1 | grep'
alias ls='ls --color'
alias grep='grep --color=auto' alias grep='grep --color=auto'
alias sudo='sudo ' alias sudo='sudo '
alias diff=colordiff
if [ -e /bin/colordiff ]; then
alias diff=colordiff
else
alias diff='diff --color'
fi
alias ls='ls --color'
if [ -e /bin/exa ]; then if [ -e /bin/exa ]; then
alias ll='exa -alhg --group-directories-first' alias ll='exa -alhg --group-directories-first'
@ -246,39 +252,43 @@ alias scus="systemctl --user start"
alias scut="systemctl --user stop" alias scut="systemctl --user stop"
alias scur="systemctl --user restart" alias scur="systemctl --user restart"
alias g='git' if [ -e /bin/git ]; then
alias gcl='git clone' alias g='git'
alias ga='git add' alias gcl='git clone'
alias grm='git rm' alias ga='git add'
alias ga='git add' alias grm='git rm'
alias gus='git reset HEAD' alias ga='git add'
alias gm="git merge" alias gus='git reset HEAD'
alias gmv='git mv' alias gm="git merge"
alias gs='git status -s -b' alias gmv='git mv'
alias gp='git push' alias gs='git status -s -b'
alias gpo='git push origin' alias gp='git push'
alias gpom='git push origin master' alias gpo='git push origin'
alias gr='git remote' alias gpom='git push origin master'
alias gd='git diff' alias gr='git remote'
alias gc='git commit -v' alias gd='git diff'
alias gca='git commit -v -a' alias gc='git commit -v'
alias gcm='git commit -v -m' alias gca='git commit -v -a'
alias gcam="git commit -v -am" alias gcm='git commit -v -m'
alias gci='git commit --interactive' alias gcam="git commit -v -am"
alias gb='git branch' alias gci='git commit --interactive'
alias gco='git checkout' alias gb='git branch'
alias gg="git log --graph --pretty=format:'%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%C(cyan)\\ [%cn]' --abbrev-commit --date=relative" alias gco='git checkout'
alias ggs="gg --stat" alias gg="git log --graph --pretty=format:'%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%C(cyan)\\ [%cn]' --abbrev-commit --date=relative"
alias gw="git whatchanged" alias ggs="gg --stat"
alias gt="git tag" alias gw="git whatchanged"
alias gnew="git log HEAD@{1}..HEAD@{0}" alias gt="git tag"
alias ggui="git gui" alias gnew="git log HEAD@{1}..HEAD@{0}"
alias ggui="git gui"
fi
alias cze="chezmoi edit" if [ -e /bin/chezmoi ]; then
alias czea="chezmoi edit --apply" alias cze="chezmoi edit"
alias czd="chezmoi diff" alias czea="chezmoi edit --apply"
alias cza="chezmoi add" alias czd="chezmoi diff"
alias czc="chezmoi cd" alias cza="chezmoi add"
alias czc="chezmoi cd"
fi
## -------------------------------------------------- ## --------------------------------------------------
## Manly Colors ## Manly Colors