How to assign nano or vim editor as default editor for crontab

Spread the love
  •  
  •  
  •  
  •  
  •  

I always had trouble using vi editor. It did not bother me much as I could use nano editor conveniently.


The situation changed when I had to use crontab for my website and it became kind of mandatory to use vi editor.

I found a decent solution to change the default vi editor to nano editor for crontab. Here are the commands :

You need to use VISUAL environment variable.

Export the value of VISUAL and then run crontab -e command.

Specify nano as the editor for crontab file

export VISUAL=nano; crontab -e

Specify vim as the editor for crontab file

export VISUAL=vim; crontab -e

NOTE : You should have nano editor or vim editor pre-installed on your system 


Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

Leave a Reply

Your email address will not be published. Required fields are marked *