Skip to content

CLI text editor

CLI Text Editors

MacOS comes with several editors (vi, pico, nano, EMACS).

Choose the default text editor in Terminal

In order to change the default text editor in bash terminal, you need to set the EDITOR and VISUAL environment variables to nano.

1- navigate to home directory cd ~

2- type ls -la to ensure that you have the .bash_profile file.

3- open .bash_profile in an editor using either atom ~/.bash_profile or nano ~/.bash_profile

4 - In the file, add the following lines to the bottom of the file and save the changes: - export EDITOR=nano - export VISUAL="$EDITOR"

5- restart terminal in order for the changes to take effect.