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.


This is one of about 5000 posts on Rubénerd. View the home page for the latest, or related posts also tagged with:

If you liked this post, feel free to buy me a coffee, leave me a comment on Twitter, or email me at Thanks :).