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:
parent
5a1ef73524
commit
9e77e83d7f
15
zshrc
15
zshrc
@ -130,19 +130,26 @@ fi
|
|||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
alias grep='grep --color=always'
|
alias grep='grep --color=always'
|
||||||
alias cninja='cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMNADS=ON'
|
which cmake &> /dev/null && \
|
||||||
alias ssh='TERM=xterm-256color ssh'
|
alias cninja='cmake -GNinja -DCMAKE_EXPORT_COMPILE_COMMNADS=ON'
|
||||||
|
which ssh &> /dev/null && \
|
||||||
|
alias ssh='TERM=xterm-256color ssh'
|
||||||
|
|
||||||
case `uname` in
|
case `uname` in
|
||||||
Linux)
|
Linux)
|
||||||
[ "$TMUX" = "" ] && \
|
[ "$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 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)
|
Darwin)
|
||||||
alias cls="clear && printf '\e[3J'"
|
alias cls="clear && printf '\e[3J'"
|
||||||
alias ls='ls -GFh'
|
alias ls='ls -GFh'
|
||||||
|
which lldb &> /dev/null && \
|
||||||
alias debug='lldb --'
|
alias debug='lldb --'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
Loading…
x
Reference in New Issue
Block a user