Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: zsh startup files



On Mar 14, 11:50am, Wayne Davison wrote:
}
} I moved all my non- interactive variable settings into ~/.zprofile (my
} interactive settings have always been in ~/.zshrc) and I reduced the
} ~/.zshenv file to these 3 lines:

My .zshenv is only two lines:

export ZDOTDIR=$HOME/.zsh
. $ZDOTDIR/.zshenv

OK, so that's cheating.

$ZDOTDIR/.zshenv has 7 lines of variable assignments so that all the
variables that were ever set by zsh (back as far as about version 2.1)
have the values they would have in whatever version that was, so that
my 15 years (gah) of accumulated zsh configuration doesn't have to be
rewritten, only added-to.  (If I haven't got around to forward-porting
it by now, it's never going to happen.)  Then it sets $path, $fpath and
a few other environment variables read from a second file that I edit
for each specific machine, so that I can just copy around all the rest
of the configuration.  (I keep it in cvs and just "cvs co" it when I
get an account in a new place.)

The only job of $ZDOTDIR/.zprofile is to search $path to be sure that,
if more than one version of zsh is found in $path, everything refers to
the most recent possible version.  If necessary it execs that zsh.

$ZDOTDIR/.zshrc sets up options, prompt strings, aliases, bindkeys,
completion, xterm title, and history.

$ZDOTDIR/.zlogin sets up the tty driver, ssh agent if it isn't yet, and
anything interactive left over from .zshrc, like $mailpath.

Back when I was using timeshared computers a lot, I had a .zlogout that
cleared the screen and any scrollback buffers, but I removed that a long
time ago; I haven't thought of any other good use for it.



Messages sorted by: Reverse Date, Date, Thread, Author