Don't set abbreviations when program doesn't exist

When switching systems, sometimes the alternatives I have set up are
not installed; in those cases, don't cause trouble!
This commit is contained in:
Gwen 2022-07-04 14:15:18 -04:00
parent 3d922d64b3
commit 064229e421
1 changed files with 23 additions and 10 deletions

View File

@ -4,24 +4,37 @@
# replacement programs.
# make common programs easier to use
abbr -ga g git
if type -q git
abbr -ga g git
end
# configure ls and tree replacement
alias exa='exa -s type' # directories first
abbr -ga ls exa -x
abbr -ga ll exa -hl
abbr -ga la exa -ax
abbr -ga tree exa -T
if type -q exa
alias exa='exa -s type' # directories first
abbr -ga ls exa
abbr -ga ll exa -hl
abbr -ga la exa -ax
abbr -ga tree exa -T
end
# add abbreviation for cargo
abbr -ga c cargo
if type -q cargo
abbr -ga c cargo
end
# configure cat replacement
alias cat='bat'
set -x BAT_THEME 'Monokai Extended'
if type -q bat
abbr -ga cat bat
set -x BAT_THEME 'Monokai Extended'
end
# configure find replacement
abbr -ga find fd
if type -q fdfind
abbr -ga find fdfind
end
# open files in the default (gui) program
abbr -ga open xdg-open
# Update path to include custom path directories
set -x PATH "$PATH:$HOME/.cargo/bin/"