Web Analytics

ouch.yazi

⭐ 174 stars Traditional Chinese by ndtoan96

🌐 語言

ouch.yazi

ouch 插件,適用於 Yazi

ouch.yazi

功能

安裝

Yazi 套件管理器

ya pkg add ndtoan96/ouch

Git

# Linux/macOS
git clone https://github.com/ndtoan96/ouch.yazi.git ~/.config/yazi/plugins/ouch.yazi

Windows with cmd

git clone https://github.com/ndtoan96/ouch.yazi.git %AppData%\yazi\config\plugins\ouch.yazi

Windows with powershell

git clone https://github.com/ndtoan96/ouch.yazi.git "$($env:APPDATA)\yazi\config\plugins\ouch.yazi"

請確保您已安裝 ouch,並將其加入您的 PATH

使用方式

預覽

若要預覽壓縮檔,請將以下內容加入您的 yazi.toml

[[plugin.prepend_previewers]]
mime = "application/{zip,tar,bzip2,7z,rar,xz,zstd,java-archive}"
run  = "ouch"

現在進入 Yazi 上的某個壓縮檔案,你應該能在預覽窗格中看到該壓縮檔案的內容。你可以使用 JK 來上下滾動預覽。

#### 自訂

你可以在 run 字串中新增額外參數來自訂預覽功能:

[plugin]
prepend_previewers = [
	# Change the top-level archive icon
	{ ..., run = "ouch --archive-icon='🗄️ '" },
	# Or remove it by setting it to ''
	{ ..., run = "ouch --archive-icon=''" },

# Enable file icons { ..., run = "ouch --show-file-icons" },

# Disable tree view { ..., run = "ouch --list-view" },

# These can be combined { ..., run = "ouch --archive-icon='🗄️ ' --show-file-icons --list-view" }, ]

壓縮

若要進行壓縮,請將此內容加入您的 keymap.toml

[[mgr.prepend_keymap]]
on = ["C"]
run = "plugin ouch"
desc = "Compress with ouch"

該插件預設使用 zip 格式。您可以在命名輸出檔案時更改格式,ouch 會根據檔案副檔名自動偵測格式。

例如,如果您想將預設格式設為 7z,可以使用 plugin ouch 7z

解壓縮

此插件未提供解壓縮功能,因為 Yazi 已經支援該功能。 若要使用 ouch 進行解壓縮,請在 yazi.toml 中設定 opener。

[opener]
extract = [
	{ run = 'ouch d -y %*', desc = "Extract here with ouch", for = "windows" },
	{ run = 'ouch d -y "$@"', desc = "Extract here with ouch", for = "unix" },
]

--- Tranlated By Open Ai Tx | Last indexed: 2026-03-03 ---