Linux E138: 无法写入 viminfo 文件 $HOME/.viminfo

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14931233/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 19:03:21  来源:igfitidea点击:

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

linuxshellcommand-lineopensuse

提问by Biswajit

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

我在我的生产环境中使用 opensuse。我以“test”用户身份登录并尝试使用“vi”编辑文件,但是当我要保存该文件时,它显示以下错误

**

**

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

E138: 无法写入 viminfo 文件 /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.

在“测试”用户下,所有文件和文件夹自动变为只读。我正在尝试使用“root”用户更改权限,但无法更改。我也寻找像“~/.viminf*”这样的临时文件,但没有这样的。

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

不知道该怎么做 pleese help.... 任何人都知道这个问题

回答by Mohammed Habib

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.

最后检查没有留下旧的临时文件(例如 ~/.viminf*)并且您可以在 .viminfo 文件的目录中写入。