更新 fish 配置,优化命令缩写以支持 bat、batcat、fd 和 fdfind 的优先使用

This commit is contained in:
2026-04-02 00:48:24 +08:00
parent 4566314b11
commit a323153e5d

View File

@@ -11,9 +11,21 @@ if status is-interactive
abbr la exa -a abbr la exa -a
end end
type -q bat; and abbr cat bat # cat/cap优先 batDebian/Ubuntu 等可能仅提供 batcat
type -q bat; and abbr cap bat -p if type -q bat
type -q fd; and abbr find fd abbr cat bat
abbr cap bat -p
else if type -q batcat
abbr cat batcat
abbr cap batcat -p
end
# find优先 fd仅存在 fdfind 时(如 Debian/Ubuntu用其并补 fd 缩写
if type -q fd
abbr find fd
else if type -q fdfind
abbr find fdfind
abbr fd fdfind
end
type -q rg; and abbr grep rg type -q rg; and abbr grep rg
type -q btop; and abbr top btop type -q btop; and abbr top btop
type -q tldr; and abbr help tldr type -q tldr; and abbr help tldr