You are not logged in.

#1 2007-06-03 14:59:45

Kei
Member
Registered: 2007-04-05
Posts: 88

Where to set the default editor?

Hi

I can't find a file to set the default editor to switch between nano and vim. I don't want to change it using an environmental var since I want to do the change for all users.

I'm sorry if it's a silly question.. Maybe I'm just too blind to see it.

Offline

#2 2007-06-03 15:14:01

nv
Member
Registered: 2006-10-24
Posts: 39

Re: Where to set the default editor?

/etc/profile sources all files in /etc/profile.d/ which have the executable bit set.

So just write a file with

export EDITOR=whatever

save it as /etc/profile.d/editor.sh and do chmod a+x on it. Next time you restart, this will be a global setting which can of course be overruled by the user's own choice.

Offline

#3 2007-06-03 15:53:29

Kei
Member
Registered: 2007-04-05
Posts: 88

Re: Where to set the default editor?

Thanks for the reply, but I still wonder, where the setting for the default editor is stored. I don't have a EDITOR variable set at the moment.

I'm just curious ;-)

Offline

#4 2007-06-03 15:59:56

waltm
Member
From: alabama
Registered: 2006-03-21
Posts: 69

Re: Where to set the default editor?

Kei wrote:

Thanks for the reply, but I still wonder, where the setting for the default editor is stored. I don't have a EDITOR variable set at the moment.

I'm just curious ;-)

its set in the code for your shell.

Offline

#5 2007-06-03 16:07:48

Kei
Member
Registered: 2007-04-05
Posts: 88

Re: Where to set the default editor?

waltm wrote:

its set in the code for your shell.

Sry, but I don't understand that. When you install Arch, you are offered to chose the default editor. If it was hardcoded, the shell would have to be recompiled while installing. Is that the case?

Offline

#6 2007-06-03 17:33:50

Acid7711
Member
From: Chicago, IL
Registered: 2006-08-18
Posts: 300
Website

Re: Where to set the default editor?

Kei wrote:
waltm wrote:

its set in the code for your shell.

Sry, but I don't understand that. When you install Arch, you are offered to chose the default editor. If it was hardcoded, the shell would have to be recompiled while installing. Is that the case?

I believe the editor you choose is only for the files you edit during the actual install. I could be wrong, but I don't think it gets written to anywhere, and that the only reason you select one is that instead of typing: 'nano /etc/rc.conf' in the install is because you select the file you want to edit and the file appears on screen ready for modifications/lookover.

Last edited by Acid7711 (2007-06-03 17:36:25)

Offline

#7 2007-06-04 00:03:52

waltm
Member
From: alabama
Registered: 2006-03-21
Posts: 69

Re: Where to set the default editor?

Kei wrote:
waltm wrote:

its set in the code for your shell.

Sry, but I don't understand that. When you install Arch, you are offered to chose the default editor. If it was hardcoded, the shell would have to be recompiled while installing. Is that the case?

That choice only applies to editing the config files during installation.  Afterwards, the shell checks if  $EDITOR is set before calling up a editor.

So, if $EDITOR is set to jed, you edit the group file in jed when you run vigr.  If not set, you get vi.

Offline

#8 2007-06-06 08:11:09

Ruckus
Member
Registered: 2007-02-17
Posts: 204

Re: Where to set the default editor?

i believe somethings use the VISUAL variable as well.

Offline

Board footer

Powered by FluxBB