fix: 修复file_preview 未带如$1 的错误
This commit is contained in:
parent
b4e5ea0a9d
commit
842a4165f7
|
|
@ -26,7 +26,7 @@ fork自 oh my zsh,更纯净 更快速
|
|||
- fzf
|
||||
- fd
|
||||
- bat (可选 更好的文本预览效果)
|
||||
- exa (可选 更好的ls预览效果)
|
||||
- exa (可选 更好的目录预览效果)
|
||||
|
||||
```plaintext
|
||||
请自行安装fd
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue