Vim Tip: Save a file with sudo-user permissions

Sometimes you need to save a file that you edited in Vim with sudo-user permissions, but you forgot to start Vim that way. The obvious strategy is to just save a temporary file and re-open the file using “sudo vim”. However, this one-liner trick uses the “tee” command to get around that. Just type this […]