dotfiles/dot_config/fish/conf.d/30-bat.fish.tmpl

23 lines
470 B
Cheetah
Raw Normal View History

2024-04-14 18:41:15 -07:00
#!/usr/bin/env fish
set -gx BATDIFF_USE_DELTA true
2024-04-21 14:32:58 -07:00
2024-04-21 14:29:37 -07:00
set -g batcmd
2024-04-14 18:41:15 -07:00
2024-04-21 14:32:58 -07:00
if command -v bat &>/dev/null
set batcmd bat
else if command -v batcat &>/dev/null
set batcmd batcat
end
2024-04-14 18:41:15 -07:00
function cat --wraps bat
2024-04-21 14:08:49 -07:00
if command -v bat &>/dev/null
bat $argv
else if command -v batcat &>/dev/null
batcat $argv
end
2024-04-14 18:41:15 -07:00
end
2024-04-18 18:40:30 -07:00
2024-04-21 14:29:37 -07:00
abbr -a B --position anywhere --set-cursor "% | $batcmd"
abbr -a --position anywhere -- -h "-h 2>&1 | $batcmd --plain --language=help"