sudo write with vim
In case you edited a file only writable by root (or another user) in vim with an unprivileged user and now want to save it without using a temporary file (and copying back this files using sudo afterward), just issue the following command instead of ':w':
:w !sudo tee %

