diff --git a/dot_config/fish/conf.d/30-bat.fish b/dot_config/fish/conf.d/30-bat.fish index 1c127f1..177a329 100644 --- a/dot_config/fish/conf.d/30-bat.fish +++ b/dot_config/fish/conf.d/30-bat.fish @@ -1,14 +1,17 @@ #!/usr/bin/env fish set -gx BATDIFF_USE_DELTA true +set -g batcmd function cat --wraps bat if command -v bat &>/dev/null + set batcmd bat bat $argv else if command -v batcat &>/dev/null + set batcmd batcat batcat $argv end end -abbr -a B --position anywhere --set-cursor "% | bat" -abbr -a --position anywhere -- -h "-h 2>&1 | bat --plain --language=help" +abbr -a B --position anywhere --set-cursor "% | $batcmd" +abbr -a --position anywhere -- -h "-h 2>&1 | $batcmd --plain --language=help"