How to make nano the default editor on the system

How to make nano the default editor on the system,also crontab.

I use MATE desktop. I use Bash

Hi @Snubbi,

I wrote this for someone today. Don’t know if it’ll work, but I’m guessing it will:

In your case you’d need to replace $BROWSER with $EDITOR.

My $EDITOR if the following:

$ echo $EDITOR

Hope this helps!

I found this page is not the right way to do it?

Add to /etc/environment FILE (for root)
or/and FOR USER to ~/.bash_profile

export EDITOR="/usr/bin/nano"

For edit /etc/sudoers with nano you need once edit sudoers config:

sudo -i
export EDITOR=nano

add at end of file:

## Set nano as default editor
Defaults env_reset
Defaults editor=/usr/bin/nano, !env_editor

Save changes in files.

1 Like

It would be better to leave sudoers untouched and make a config file in /etc/sudoers.d/ name it 20-whatever and add the changes there.

1 Like