I use Vim as my editor.
I wanted to have syntax colouring when editing Crontab with
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
.viminfo exists in my home dir and has sensible permissions:
-rw-------. 1 me me 11K 15.10. 12:49 .viminfo
/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
What is causing this error message and how can I enable syntax colouring when editing Crontab without it?
If I rename
.viminfo the error changes:
E138: Cannot write viminfo file /home/me/.viminfo!