This article describes how to set the default text editor in the Linux command-line environment.
You can change the default command-line text editor used by various programs, such as crontab. For example, many accounts are configured to use nano as the default text editor. However, if you are more familiar with vi, you may want to use it as the default editor instead.
To change the default command-line text editor, follow these steps:
export EDITOR='program' export VISUAL='program'
To make the new default text editor settings take effect, log out of your account and then log back in. Alternatively, you can just type the following command: