mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
feat: lz and lz4 archives support
This commit is contained in:
parent
329c5d28f0
commit
75575496aa
4 changed files with 5 additions and 5 deletions
|
|
@ -243,7 +243,7 @@ rules = [
|
|||
# Media
|
||||
{ mime = "{audio,video}/*", fg = "magenta" },
|
||||
# Archive
|
||||
{ mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "red" },
|
||||
{ mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,*lzip,*lz4,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "red" },
|
||||
# Document
|
||||
{ mime = "application/{pdf,doc,rtf}", fg = "cyan" },
|
||||
# Virtual file system
|
||||
|
|
|
|||
|
|
@ -243,7 +243,7 @@ rules = [
|
|||
# Media
|
||||
{ mime = "{audio,video}/*", fg = "magenta" },
|
||||
# Archive
|
||||
{ mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "red" },
|
||||
{ mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,*lzip,*lz4,lzma,compress,archive,cpio,arj,xar,ms-cab*}", fg = "red" },
|
||||
# Document
|
||||
{ mime = "application/{pdf,doc,rtf}", fg = "cyan" },
|
||||
# Virtual file system
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ rules = [
|
|||
# Media
|
||||
{ mime = "{audio,video}/*", use = [ "play", "reveal" ] },
|
||||
# Archive
|
||||
{ mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", use = [ "extract", "reveal" ] },
|
||||
{ mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,*lzip,*lz4,lzma,compress,archive,cpio,arj,xar,ms-cab*}", use = [ "extract", "reveal" ] },
|
||||
# JSON
|
||||
{ mime = "application/{json,ndjson}", use = [ "edit", "reveal" ] },
|
||||
{ mime = "*/javascript", use = [ "edit", "reveal" ] },
|
||||
|
|
@ -148,7 +148,7 @@ previewers = [
|
|||
# PDF
|
||||
{ mime = "application/pdf", run = "pdf" },
|
||||
# Archive
|
||||
{ mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", run = "archive" },
|
||||
{ mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,*lzip,*lz4,lzma,compress,archive,cpio,arj,xar,ms-cab*}", run = "archive" },
|
||||
{ mime = "application/{debian*-package,redhat-package-manager,rpm,android.package-archive}", run = "archive" },
|
||||
{ url = "*.{AppImage,appimage}", run = "archive" },
|
||||
# Virtual Disk / Disk Image
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ function M.tmp_name(url) return ".tmp_" .. ya.hash(string.format("extract//%s//%
|
|||
|
||||
function M.trim_ext(name)
|
||||
-- stylua: ignore
|
||||
local exts = { ["7z"] = true, apk = true, bz2 = true, bzip2 = true, cbr = true, cbz = true, exe = true, gz = true, gzip = true, iso = true, jar = true, rar = true, tar = true, tgz = true, xz = true, zip = true, zst = true }
|
||||
local exts = { ["7z"] = true, apk = true, bz2 = true, bzip2 = true, cbr = true, cbz = true, exe = true, gz = true, gzip = true, iso = true, jar = true, lzip = true, lz = true, lz4 = true, rar = true, tar = true, tgz = true, xz = true, zip = true, zst = true }
|
||||
|
||||
while true do
|
||||
local s = name:gsub("%.([a-zA-Z0-9]+)$", function(s) return (exts[s] or exts[s:lower()]) and "" end)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue