E138: Can't write viminfo file $HOME/.viminfo

Biswajit picture Biswajit · Feb 18, 2013 · Viewed 30.8k times · Source

I am using opensuse for my production environment. I am login as "test" user and trying to edit a file using "vi" but when i am going to save that file it shows the following error

**

E138: Can't write viminfo file /home/test/.viminfo

**

Under the "test" user all the files and folder autometically become read-only. I am trying to change the permission using "root" user but unable to change it. also I look for temp file like "~/.viminf*" but there nothing like this.

Don't know what to do plaese help.... anyone aware about this problem

Answer

Mohammed Habib picture Mohammed Habib · Feb 18, 2013

Fix your home directory owner and permissions.

sudo chown -R test /home/test

sudo chmod u+rw -R /home/test

And finally check that no old temp files were left behind (e.g. ~/.viminf*) and that you can write in the directory of the .viminfo file.