Setting nano or pico as default editor in CentOS instead of Vi

[ March 5, 2018 ]

If you prefer nano to the vi editor in Linux, or if you have a bad habit of typing pico to start your editor you can fix that relatively quickly and easily in CentOS.

First, login as root and then make sure nano is installed.

If not, install it:

yum install nano

Now that we know it is installed, run this:

nano /etc/bashrc

Then add this line somewhere in the file (at the bottom is a good place)

export EDITOR=”nano”

Then reset your shell or log out and login again. Next time you do certain functions like edit the crontab, nano will be the default editor.


Related Articles