Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Dec 2015 20:46:01 +0100
From:      Polytropon <freebsd@edvax.de>
To:        Bertram Scharpf <lists@bertram-scharpf.de>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: freebsd-update editor choice
Message-ID:  <20151215204601.bd653269.freebsd@edvax.de>
In-Reply-To: <20151215124601.GA4020@becker.bs.l>
References:  <20151213182848.M69104@brightstar.bomgardner.net> <20151215124601.GA4020@becker.bs.l>

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
shells).



>   - 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").






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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20151215204601.bd653269.freebsd>