I use Vim as my editor.
I wanted to have syntax colouring when editing Crontab with crontab -e
.
I followed this answer. After setting variable EDITOR=vim
and exporting it crontab -e
now shows syntax colours like I wanted. I am editing Crontab as my own user, not using Sudo.
However this causes error when closing Crontab:
/tmp/crontab.019kNj" 4L, 278C written
E886: Can't rename viminfo file to /home/me/.viminfo!
Press ENTER or type command to continue
This happens both when saving changes and when closing without saving.
Error happens only with Crontab, editing files directly with Vim works without problem.
Behavior is similar when using variable VISUAL
instead of EDITOR
.
The file .viminfo
exists in my home dir and has sensible permissions:
-rw-------. 1 me me 11K 15.10. 12:49 .viminfo
Permissions of /home/me
make sense too:
drwx------. 33 me me 4,0K 15.10. 13:13 me
OS version is Red Hat Enterprise Linux Workstation release 7.9 (Maipo)
, Vim version is VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jan 29 2020 08:09:16)
and shell is GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)
. Version of Crontab is crontabs-1.11-6.20121102git.el7.noarch
.
What is causing this error message and how can I enable syntax colouring when editing Crontab without it?
EDIT:
If I rename .viminfo
the error changes:
E138: Cannot write viminfo file /home/me/.viminfo!
vim
as usual does not cause the same type of diagnostic message?/tmp
permissions alright? It would be nice to see the permissions of all directories and files involved in the error message.vim --version | head -n1
show you? Specifically, is it more recent than8.0
, as there was a bug that got fixed in 8.0.1024