When I :q vim on my debian root account (not even writing), it always displays an error message:
E138: Can't write viminfo file $HOME/.viminfo!
.viminfo
didn't exist, so I created it and checked the permissions of /root
and the file, but they were fine:
drwx------ 3 root root 4.0K Sep 16 11:13 .
-rw-r--r-- 1 root root 0 Sep 16 11:13 /root/.viminfo
$HOME
exists as an environment variable:
~ # echo $HOME
/root
in vim :!echo $HOME
returns empty output. How can I get rid off this error, why isn't vim accepting $HOME?
env HOME="/root" vim --noplugin
.vim --noplugin
. Thenenv HOME="/root" vim
./etc/vim/vimrc.local
global config but still get same error. Okay, it's a probably not a vim issue, right?/root/.vim
directory rather than under/etc
or/usr/share/vim
. Trygrep -r HOME /root/.vim /root/.vimrc
.