You are not logged in.

#1 2011-02-10 01:09:13

mark367
Member
From: New Zealand
Registered: 2011-02-03
Posts: 2

How to set the default editor to NANO globally

Does anyone know howto set the default editor to nano for the entire system.

When I try to edit a crontab job using sudo I get the vi editor.

for example:-

sudo crontab -e (editor is vi)

run the following to get to a root prompt...

sudo su

then run...

export VISUAL=nano

then...

crontab -e (editor is nano)

exit back to user prompt
run...

sudo crontab -e (editor is vi again)

Any ideas? Thx in advance.

Offline

#2 2011-02-10 01:23:43

sisco311
Member
From: Romania
Registered: 2008-05-23
Posts: 112

Re: How to set the default editor to NANO globally


don't drink unwashed fruit juice.
i never make predictions, especially about the future.

Offline

#3 2011-02-10 01:24:15

milso
Member
Registered: 2010-11-16
Posts: 112
Website

Re: How to set the default editor to NANO globally

You could make an alias in your .bashrc such that

alias crontabedit='sudo EDITOR=nano crontab -e'

Offline

#4 2011-02-10 01:44:13

mark367
Member
From: New Zealand
Registered: 2011-02-03
Posts: 2

Re: How to set the default editor to NANO globally

Thanks, the rename vi and link did the trick.
Cheers :-)

Offline

#5 2011-02-10 07:17:59

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: How to set the default editor to NANO globally

FYI method 2 on that page is the right way.

Offline

Board footer

Powered by FluxBB