From bbe0b30222b84b4c1a4bfcfddc880955d4b01c1f Mon Sep 17 00:00:00 2001 From: Brad Ganley Date: Sat, 24 Feb 2024 00:51:34 +0000 Subject: [PATCH] Also made the batcat alias conditional to solve headaches I've been having for 5 years --- .bashrc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index d08716a..5f14ef4 100644 --- a/.bashrc +++ b/.bashrc @@ -4,8 +4,13 @@ alias sudo='sudo ' #what cd should do by default -alias cd='cd_func' -alias bat='batcat ' +if command -v batcat &> /dev/null +then + alias cd='cd_func' + alias bat='batcat ' +fi + + cd_func () { builtin cd "$@" && ls --color=auto --group-directories-first --format=single-column