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