Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

🗜️ compress.yazi

A blazing fast, flexible archive plugin for Yazi
Effortlessly compress your files and folders with style!

📖 Table of Contents

🚀 Features

  • 🗂️ Multi-format support: zip, 7z, rar, tar, tar.gz, tar.xz, tar.bz2, tar.zst, tar.lz4, tar.lha
  • 🌍 Cross-platform: Works on Unix & Windows
  • 🔒 Password protection: Secure your archives (zip/7z/rar)
  • 🛡️ Header encryption: Hide file lists (7z/rar)
  • Compression level: Choose your balance of speed vs. size
  • 🛑 Overwrite safety: Never lose files by accident
  • 🎯 Seamless Yazi integration: Fast, native-like UX

📦 Supported File Types

ExtensionDefault Command7z CommandBsdtar Command (Win10+ & Unix)
.zipzip -r7z a -tziptar -caf
.7z7z a7z a
.rarrar a
.tartar rpftar rpf
.tar.gztar rpf + gzip7z a -tgziptar -czf
.tar.xztar rpf + xz7z a -txztar -cJf
.tar.bz2tar rpf + bzip27z a -tbzip2tar -cjf
.tar.zsttar rpf + zstdtar --zstd -cf
.tar.lz4tar rpf + lz4
.tar.lhatar rpf + lha

⚡️ Installation

# Unix
git clone https://github.com/KKV9/compress.yazi.git ~/.config/yazi/plugins/compress.yazi

# Windows (CMD, not PowerShell!)
git clone https://github.com/KKV9/compress.yazi.git %AppData%\yazi\config\plugins\compress.yazi

# Or with yazi plugin manager
ya pkg add KKV9/compress

🔧 Extras (Windows)

To enable additional compression formats and features on Windows, follow these steps:

  1. Install 7-Zip:
    Add C:\Program Files\7-Zip to your PATH.
    This enables support for .7z archives and password-protected .zip files.

  2. Alternative: Install Nanazip:
    A modern alternative to 7-Zip with similar functionality and extra features.

  3. Install WinRAR:
    Add C:\Program Files\WinRAR to your PATH.
    This enables support for .rar archives.

  4. Install Additional Tools:
    To use formats like lha, lz4, gzip, etc., install their respective tools and ensure they are added to your PATH.

🎹 Keymap Example

Add this to your keymap.toml:

[[mgr.prepend_keymap]]
on   = [ "c", "a", "a" ]
run  = "plugin compress"
desc = "Archive selected files"

[[mgr.prepend_keymap]]
on   = [ "c", "a", "p" ]
run  = "plugin compress -p"
desc = "Archive selected files (password)"

[[mgr.prepend_keymap]]
on   = [ "c", "a", "h" ]
run  = "plugin compress -ph"
desc = "Archive selected files (password+header)"

[[mgr.prepend_keymap]]
on   = [ "c", "a", "l" ]
run  = "plugin compress -l"
desc = "Archive selected files (compression level)"

[[mgr.prepend_keymap]]
on   = [ "c", "a", "u" ]
run  = "plugin compress -phl"
desc = "Archive selected files (password+header+level)"

🛠️ Usage

  1. Select files/folders in Yazi.
  2. Press c a to open the archive dialog.
  3. Choose:
    • a for a standard archive
    • p for password protection (zip/7z/rar)
    • h to encrypt header (7z/rar)
    • l to set compression level (all compression algorithims)
    • u for all options together
  4. Type a name for your archive (or leave blank for suggested name).
  5. Enter password and/or compression level if prompted.
  6. Overwrite protect if a file already exists, the new file will be given a suffix _#.
  7. Enjoy your shiny new archive!

🏳️‍🌈 Flags

  • Combine flags for more power!
  • when separating flags with spaces, make sure to single quote them (eg., '-ph rar')
  • -p Password protect (zip/7z/rar)
  • -h Encrypt header (7z/rar)
  • -l Set compression level (all compression algorithims)
  • -s Silence success message
  • <extention> Specify a default extention (eg., 7z, tar.gz)

Combining multiple flags:

[[mgr.prepend_keymap]]
on   = [ "c", "a", "7" ]
run  = "plugin compress '-ph 7z'"
desc = "Archive selected files to 7z (password+header)"
[[mgr.prepend_keymap]]
on   = [ "c", "a", "r" ]
run  = "plugin compress '-p -l rar'"
desc = "Archive selected files to rar (password+level)"

💡 Tips

  • The file extension must match a supported type.
  • The required compression tool must be installed and in your PATH (7zip/rar etc.).
  • If no extention is provided, the default extention (zip) will be appended automatically.
  • If you leave the filename blank, the plugin will use the selected filename or parent directory, when multiple files are selected, to name the archive.

📣 Credits

Made with ❤️ for Yazi by KKV9. Contributions are welcome! Feel free to submit a pull request.

关于 About

A Yazi plugin that compresses selected files to an archive.
archivecompressionyaziyazi-pluginzip

语言 Languages

Lua100.0%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
23
Total Commits
峰值: 4次/周
Less
More

核心贡献者 Contributors