VI won't let me save my vimrc file

I have changed the permissions to allow for:

-rwxrwxr-- 1 root root 2214 Oct 4 09:45 vimrc

and it still won't let me save to the file. I only have one user on this box and it has admin rights. Everytime I make changes to the file and try and save it tells me I'm trying to make changes to a read only file and to hit ! to override. When I do that and hit !ZZ it still doesn't save.

1

2 Answers

-rwxrwxr-- 1 root root means the file belongs to the root user and that only him and users from the group 'root' may write to it.

You can use your sudo powers and run sudo vim vimrc or you could change the owner with sudo chown <insert-your-username-here> vimrc and then edit it with vim vimrc

1

Use :w! to override read-only, instead. Edit the file with sudo vi <filename> if necessary.

Also, it looks like you may be trying to edit /etc/vim/vimrc. Don't do that ; edit ~/.vimrc (or /home/youruser/.vimrc) instead.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like