Another possibility, for the case in which you do not have sudo privileges, is to use :w /somewhere/where/i/have/permissions/foo.txt
, and then deal with the permissions issue later, as per Ryan Fox.
↧
Answer by Jonathan Ben-Avraham for Using vim to force edit a file when you opened without permissions
↧