No syntax highlighting when editing crontab

cronhighlightingvim

I am trying to figure out why I don't have syntax highlighting when editing my crontab.

I have both $EDITOR and $VISUAL set to /usr/bin/vim:

> echo $EDITOR
/usr/bin/vim
> echo $VISUAL
/usr/bin/vim

If I save the crontab to a file and edit it with vim syntax highlighting is enabled.

> crontab -l > saved_cronab
> /usr/bin/vim saved_crontab

And if I use :syntax on while editing the crotab nothing changes

How can I enable highlighting when editing crontab with crontab -e?

Best Answer

Did you export these variables (export EDITOR VISUAL)?

Related Question