Browsing tar files with Vim


Houki isn’t sure why she’s in a tape archive

Here’s a neat trick I learned today, entirely by accident. Say you were to open a tar file with Vim:

$ vim firewall-team.tar

You can view its contents and even edit the files inline!

" tar.vim version v26
" Browsing tarfile [..]/firewall-team.tar
" Select a file with cursor and press ENTER

By comparison, nvi on FreeBSD and NetBSD will return fireworks. For certain times of the year this may be desirable, but may not be legal in certain juristictions. It’s also likely not what you’re after when browsing tar files.


Emacs can also be used to read tar files, if your pinkie isn’t prone to repetitive stress injuries.

Author bio and support


Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person. Hi!

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite bespoke cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.