Update .config/fish/conf.d/30-bat.fish
This commit is contained in:
parent
1452fa7a5d
commit
4cb4bb57cc
1 changed files with 5 additions and 2 deletions
|
@ -1,14 +1,17 @@
|
||||||
#!/usr/bin/env fish
|
#!/usr/bin/env fish
|
||||||
|
|
||||||
set -gx BATDIFF_USE_DELTA true
|
set -gx BATDIFF_USE_DELTA true
|
||||||
|
set -g batcmd
|
||||||
|
|
||||||
function cat --wraps bat
|
function cat --wraps bat
|
||||||
if command -v bat &>/dev/null
|
if command -v bat &>/dev/null
|
||||||
|
set batcmd bat
|
||||||
bat $argv
|
bat $argv
|
||||||
else if command -v batcat &>/dev/null
|
else if command -v batcat &>/dev/null
|
||||||
|
set batcmd batcat
|
||||||
batcat $argv
|
batcat $argv
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
abbr -a B --position anywhere --set-cursor "% | bat"
|
abbr -a B --position anywhere --set-cursor "% | $batcmd"
|
||||||
abbr -a --position anywhere -- -h "-h 2>&1 | bat --plain --language=help"
|
abbr -a --position anywhere -- -h "-h 2>&1 | $batcmd --plain --language=help"
|
||||||
|
|
Loading…
Reference in a new issue