Since we're sharing shell tricks: The "sudo tee > /dev/null" may be baroque, but I find it useful whenever I start editing stuff in /etc in vim, only to find that I cannot write my changes because I'm not root. In that case,
:w !sudo tee %
does the trick. (What "w!" does is send the buffer into the given shell command as stdin.)