Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

How to handle compressed files with Vim

📅 2019-Dec-29 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ ⬩ 📚 Archive

Vim has support for compressed file formats such as zip, tar, gzip, bzip2 and many others. The supported operations are pretty simple: list the files inside the compressed file, view or edit one of those files and save the edited file back to the compressed file.

$ vim foobar.zip
$ vim foobar.tar.bz2

This will display the list of files inside the compressed file in the Vim edit window. The listing is flat: subdirectories and files within them are all listed in the edit window with the absolute file paths.

.zip
.tar
.gz
.bz2
.Z
.lzma
.xz
.lz
.zst

Tried with: Vim 8.0 and Ubuntu 18.04