fix: 修复file_preview 未带如$1 的错误

This commit is contained in:
chenyc 2022-11-04 18:16:16 +08:00
parent b4e5ea0a9d
commit 842a4165f7
2 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ fork自 oh my zsh更纯净 更快速
- fzf
- fd
- bat (可选 更好的文本预览效果)
- exa (可选 更好的ls预览效果)
- exa (可选 更好的目录预览效果)
```plaintext
请自行安装fd

View File

@ -2,7 +2,7 @@
mime=$(file -bL --mime-type "$1")
category=${mime%%/*}
if [ -d "$1" ]; then
exa -l --no-user --no-time --icons 2>/dev/null || ls --color=tty "$1" || ls -G "$1"
exa -l --no-user --no-time --icons "$1" 2>/dev/null || ls --color=tty "$1" || ls -G "$1"
elif [ "$category" = text ]; then
(bat -p --color=always "$1" || cat "$1") 2>/dev/null | head -100
elif [ "$category" = image ]; then