1

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
  • 1
    Where is that file located? As far as I kow it shoud be named .vimrc, not vimrc... – Radu Rădeanu Oct 4 '13 at 15:24
3

-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
  • to use the chown command do i need to use the sudo command as well? – zombiedad Oct 4 '13 at 17:52
2

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

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.