You are not logged in.
Pages: 1
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
/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
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
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
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
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
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
i believe somethings use the VISUAL variable as well.
Offline
Pages: 1