Vim can view tar files (go ahead, open a tarball, it's pretty cool), it lets you navigate through the tarball and even open the files within. On linux systems I can edit these files and even save them! But on OSX I get an odd error:
***error*** (tar#Write) sorry, unable to update /ball.tar with file/in/tar.ball
Googling seems to fail me. In fact documentation I can find seems to indicate vim shouldn't even support editing these tarballs (though I can very clearly do it on multiple systems with the default vim installation).
Turns out, the version of tar that ships with OSX doesn't have a feature that's required for this (specifically: --delete, could be others as well but this one definitely)!
By installing (and using) the gnu version of tar, this will start to work. You can do this by installing gnu-tar with homebrew, though this installs it as gtar so to have vim use it you need to do one of two things:
--with-default-names flagPATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH"EDIT: As @Amadan mentioned in a comment, you can also add this to your vim config:
let g:tar_cmd="/usr/local/bin/gtar"
After installing gnu-tar, which will give you all the magic with no side effects.
Install GNU tar and use it in vim:
brew install gnu-tar
echo 'let g:tar_cmd="/usr/local/bin/gtar"' >> ~/.vimrc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With