Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Dec 2015 20:46:01 +0100
From:      Polytropon <>
To:        Bertram Scharpf <>
Subject:   Re: freebsd-update editor choice
Message-ID:  <>
In-Reply-To: <>
References:  <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Tue, 15 Dec 2015 13:46:01 +0100, Bertram Scharpf wrote:
> Hi,
> On Sunday, 13. Dec 2015, 12:31:22 -0600, Gene wrote:
> > I'm using freebsd-update to update my 10.1 system to 10.2. When merging files,
> > it insists on using the 'vi' editor. I really, really, REALLY, despise vi. Is
> > there a way to get it to use another editor?
> The problem I fussed about many times and long times without
> any understanding up to this day is not how but _where_ to
> set the EDITOR environment variable. There is
>   - /etc/login.conf

This will set environment variables globally for all users
who login, not depending on the shell. There is also a user-level
file ~/.login_conf which overrides settings made in the global
file for a specific user upon login.

>   - /etc/rc

Don't touch this file! :-)

>   - /etc/profile (and /etc/zprofile)

This applies for sh and zsh globally.

>   - /etc/csh.cshrc (or /etc/zshrc)

This is for the C shell.

>   - ~/.profile (and ~/.zprofile)

This is the user-specific file for sh and zsh. It will override
any settings made in the global files. It will be read if the
shell is a login shell.

>   - ~/.shrc, ~/.cshrc, (or ~/.zshrc)

Similar for sh, csh and zsh, except .shrc and .zshrc will be
applied to interactive shells (which aren't neccessarily login

>   - probably some more I forgot here

For bash: .bash_profile, -bash_login, and .bashrc.

> Some programs change their behaviour in dependence of the
> EDITOR variable. For example if you log into a host with the
> command
>   $ ssh otherhost -t tmux
> most of the above files are left unregarded and the TMux
> option 'status-keys' may be set to an undesired value.

This depends on how login shells and interactive shells are
being configured and how they inherit environmental variables.

> Is there any documentation in which order and under which
> circumstances the above files are executed or come into
> respect?

Yes. Those informations can be found in the manual pages
of the respective shells ("man sh", "man csh", "man zsh",
and "man bash").

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

Want to link to this message? Use this URL: <>