If you want to change your Linux default editor, read the article for how to do it. Setting nano as default editor permanently in Linux.

I don’t like to use Vi, Vim or etc. It can be painfully for me when i need to edit something. They’re old-school editors and i’m not a fan.
Anyway, this post will guide you to change your default editor in your Linux. Your linux distro can be Ubuntu, Centos or etc.
How to set default editor as nano?
- Open the terminal or log in to your server using SSH.
- Open the
~/.bashrc
file with a text editor. If you’re in the root directory, you can just typenano .bashrc
to the console. - Add the following line to bottom of file.
export EDITOR='/usr/bin/nano'
- Reload your profile file with the following command or, logout and login back.
source ~/.bashrc
Thats it!
If you’re using another shell in your terminal like ZSH, you should use relevant profile file. For ZSH it’s .zshrc