Edit the .bash_profile file in your home directory
vi ~/.bash_profile
Add the following lines to your .bash_profile file
export VISUAL=vim export EDITOR="$VISUAL"
Note: Replace vim with any other preferred editor such as **_nano
_**
Logout and login again for changes to take effect.
If you want the changes to come into play immediately, execute the following command
. ~/.bash_profile