Closed Nelyah closed 3 years ago
Hi, I was browsing your dotfiles in search of ideas to add to mines. However, I noticed this function you had:
https://github.com/akinsho/dotfiles/blob/56be4352ea8d6f2311df92b0bca052f3e248ec32/zsh/scripts/functions.sh#L16
I would imagine that you always have bat installed, but if you don't you actually get a recursion loop. I would suggest using the command like so:
bat
command
cat() { if hash bat 2>/dev/null; then bat "$@" else command cat "$@" fi }
command will skip the search of functions named cat (in this case), which is what we want. Hope it helps!
cat
@Nelyah thanks for pointing this out, sorry I didn't really notice the issues somehow I wasn't watching my own dotfiles repo 😆
Hi, I was browsing your dotfiles in search of ideas to add to mines. However, I noticed this function you had:
https://github.com/akinsho/dotfiles/blob/56be4352ea8d6f2311df92b0bca052f3e248ec32/zsh/scripts/functions.sh#L16
I would imagine that you always have
bat
installed, but if you don't you actually get a recursion loop. I would suggest using thecommand
like so:command
will skip the search of functions namedcat
(in this case), which is what we want. Hope it helps!