I recently upgraded vi to vim on one of my servers and was puzzled why changes weren’t being saved when I edited my crontab file using crontab -e. I would make changes to the file, save them, but still get this error:
crontab: no changes made to crontab
I found a lot of unhelpful advice from checking permissions on the files and directories, to using different editors, to checking cron.allow and cron.deny. None of those worked.
It turns out that .vimrc needs to have a one line configuration option set. You’ll find .vimrc in your home directory (/root for superuser). Just add this line:
and you’re on your way.