Urie96 / preview.yazi

40 stars 2 forks source link

preview.yazi

Preview image/video/pdf/archive/ipynb/so/sqlite/svg/docx/xlsx/dex/dmg/ipa/apk/ttf/woff/... on Yazi written in Bash.

20240409205847 20240409205415 20240409205637 20240409205748

Requirements

Installation

# Linux/macOS
git clone https://github.com/Urie96/preview.yazi.git ~/.config/yazi/plugins/preview.yazi

# Windows is unsupported

Dependencies

# Mac OS
brew install bat ffmpegthumbnailer unar poppler exiftool tree \
  glow imagemagick pandoc sqlite smali miller transmission-cli woff2 # optional in this line
pipx install nbconvert xlsx2csv # optional

# Arch Linux
sudo pacman -S --needed bat ffmpegthumbnailer unarchiver poppler perl-image-exiftool tree \
  glow imagemagick pandoc-bin sqlite smali miller android-tools transmission-cli catdoc docx2txt woff2 # optional in this line
pipx install nbconvert xlsx2csv # optional

# Ubuntu/Debian
sudo apt install bat ffmpegthumbnailer unar poppler-utils exiftool tree \
  glow imagemagick pandoc sqlite miller transmission-cli catdoc docx2txt woff2 # optional in this line
pipx install nbconvert xlsx2csv # optional

Usage

Add this to your yazi.toml:

[plugin]
previewers = [
  { name = "*/", run = "folder", sync = true },
  { name = "*.md", run = "preview" },
  { name = "*.csv", run = "preview" },
  { mime = "text/*", run = "code" },
  { mime = "*/xml", run = "code" },
  { mime = "*/javascript", run = "code" },
  { mime = "*/x-wine-extension-ini", run = "code" },
  { name = "*", run = "preview" },
]