Quantcast
Viewing latest article 4
Browse Latest Browse All 4

Vim Error 'E212: Cannot open file for writing', when trying to create new files outside of home dir

I am running Wheezy Debian. When I try to create a new file in a directory other than my home directory, such as /var/www, I get the following error in vim:

E212: Cannot open file for writing.

I assume this is because I do not have the correct privileges to create files outside of my home directory?

My user account is in the sudoers file with (ALL=(ALL) ALL), and I have administrator access.

I'm aware of tricks such as :w !sudo tee %, however this still results in a readonly file.

What am I missing here?


Viewing latest article 4
Browse Latest Browse All 4

Trending Articles