如何在 Emacs 中解压/解压
我想在 dired 或类似 dired 的缓冲区中运行 unzip (甚至 zip)。有这样的事吗?我想要类似于 Nautilus 文件管理器的功能:即选择文件,然后按击键将这些文件放入新的存档文件中。
谢谢
I would like to run unzip (or even zip) within dired or a dired-like buffer. Is there anything like this? I would like something similar as in the Nautilus file manager: i.e., selecting files and then pressing a keystroke to get these files into a new archive file.
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您有选择...
要解压缩 .zip 文件,您只需添加到变量
'dired-compress-file-suffixes
现在的
Z
键dired 将识别 .zip 扩展名并解压缩 .zip 存档。已支持的有gunzip
、bunzip2
、uncompress
和dictunzip
。如果您想标记文件并将其添加到 .zip 存档中,您可以使用以下命令将
z
绑定为压缩标记文件集:You've got options...
To uncompress a .zip file, you just need to add to the variable
'dired-compress-file-suffixes
Now the
Z
key in dired will recognize the .zip extension and uncompress a .zip archive. Already supported aregunzip
,bunzip2
,uncompress
anddictunzip
.If you want to mark files and add them to a .zip archive you can use the following to make
z
bound to zip the set of marked files:要压缩文件,请打开 dired 中的目录。用
m
标记要压缩的文件。然后输入要从 dired 中提取整个存档,您可以标记一个文件并运行
& unzip
,就像在 shell 中一样。zip 存档模式将允许您以类似 dired 的方式浏览 zip 文件。它应该随最新版本的 GNU emacs 一起提供,并且当您访问扩展名为 .zip 的文件时将默认使用它。在此模式下,您可以将单个文件提取到缓冲区中,然后使用
Cx Cs
保存它们。To zip files, open the directory in dired. Mark the files you want to zip with
m
. Then typeTo extract an entire archive from dired you can mark a file and run
& unzip
, just as you would in a shell.zip-archive mode will allow you to browse zip files in a dired-like fashion. It should come with recent versions of GNU emacs and will be used by default when you visit a file with the .zip extension. From this mode you can extract individual files into a buffer, and from there save them with
C-x C-s
.