From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18015 invoked by alias); 28 Apr 2012 23:03:59 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17037 Received: (qmail 16226 invoked from network); 28 Apr 2012 23:03:57 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <120428160334.ZM15454@torch.brasslantern.com> Date: Sat, 28 Apr 2012 16:03:34 -0700 In-reply-to: <4B2741961D3F4053AD4A3F6A195E2371@gmail.com> Comments: In reply to TJ Luoma "do you use separate .zshenv and .zshrc files?" (Apr 28, 3:07pm) References: <4B2741961D3F4053AD4A3F6A195E2371@gmail.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: do you use separate .zshenv and .zshrc files? MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Apr 28, 3:07pm, TJ Luoma wrote: } } ISTM that it would be easier to just keep everything in one file and } separate the login stuff using the `if` statement above. } } Are there any drawbacks to that method? In addition to the items other have mentioned ... If you have a lot of configuration it may take somewhat longer to parse and execute the one big file when all that's going to happen is that a large part of it will be skipped. Remember that an "if" is a compound statement which has to all be read into memory to be sure it parses correctly before any of it can be executed (or discarded, if the condition is false). So a giant "if [[ -o interactive ]]; ..." may needlessly consume memory and time. I have a multi-file configuration which consists of $HOME/.zshenv which sets ZDOTDIR to point at a directory checked out of a source code repository which contains the actual initialization files. Within that directory are subdirectories for each host or host type for which there is a customized config. I symlink one of those to "local" and then in (for example) $ZDOTDIR/.zshrc I will have desire $ZDOTDIR/local/termsetup where "desire" is a function defined early like desire() { [[ -O $1 ]] && source $1 } so I don't have to care if a particular local configuration is missing.