Main.ChangeCrontabEditor


Editing crontab is done via the default text editor specified using the EDITOR environment variable. In order to customize this to an editor of your choice you need to modify this value before launching a crontab editing session.

Modify EDITOR environment variable:

  export EDITOR='nano'

change the value nano to the command that will run the editor of your choice. Default commandline parameters can also be provided.

You can confirm the value is set be entering:

  echo $EDITOR

...and the current value will be output.

Launching a crontab editing session is done by this invocation:

  crontab -e

This will edit the crontab for the current user (as shown by the pwd command) in your selected text editor. When you save and quit after making changes, the crontab is reloaded, and hopefully will apply to your operations from then on.

Changing the default permanently

The above changes will only apply per session. In order to apply the changed editor for all subsequent logins, modify your .bashrc file (in your /home directory) to include the following line:

export VISUAL=youreditor

where youreditor is the command name of the editor you wish to use.

Links

See also