Forget to open vim with sudo? No problem.
If you already opened vim without sudo
and made edits to a file for which you do not have write permissions, use this command to redeem yourself:
:w !sudo tee > /dev/null %
Written by Allyson Beckers
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#