Only add aliases when the target command exists
Previously aliases for commands were added without checking if the command being aliased existed first, this is now not the case.
This commit is contained in:
17
zshrc
17
zshrc
@@ -130,20 +130,27 @@ fi
|
||||
|
||||
# Aliases
|
||||
alias grep='grep --color=always'
|
||||
alias cninja='cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMNADS=ON'
|
||||
alias ssh='TERM=xterm-256color ssh'
|
||||
which cmake &> /dev/null && \
|
||||
alias cninja='cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMNADS=ON'
|
||||
which ssh &> /dev/null && \
|
||||
alias ssh='TERM=xterm-256color ssh'
|
||||
|
||||
case `uname` in
|
||||
Linux)
|
||||
[ "$TMUX" = "" ] && \
|
||||
alias cls="printf '\ec'" || alias cls="clear && printf '\e[3J'"
|
||||
alias cls="printf '\ec'" || \
|
||||
alias cls="clear && printf '\e[3J'"
|
||||
alias ls='ls -F --color=auto'
|
||||
alias debug='cgdb --args'
|
||||
which cgdb &> /dev/null && \
|
||||
alias debug='cgdb --args' || \
|
||||
which gdb &> /dev/null && \
|
||||
alias debug='gdb --args'
|
||||
;;
|
||||
Darwin)
|
||||
alias cls="clear && printf '\e[3J'"
|
||||
alias ls='ls -GFh'
|
||||
alias debug='lldb --'
|
||||
which lldb &> /dev/null && \
|
||||
alias debug='lldb --'
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
Reference in New Issue
Block a user