From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2827 invoked by alias); 28 Apr 2012 22:25: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: 17036 Received: (qmail 3674 invoked from network); 28 Apr 2012 22:25:58 -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 autolearn=ham version=3.3.2 Received-SPF: pass (ns1.primenet.com.au: SPF record at benizi.com designates 64.130.10.15 as permitted sender) Date: Sat, 28 Apr 2012 18:25:29 -0400 (EDT) From: "Benjamin R. Haskell" To: TJ Luoma cc: zsh-users@zsh.org Subject: Re: do you use separate .zshenv and .zshrc files? In-Reply-To: <07DD5A5D889944F7B10E983AF5776A6D@gmail.com> Message-ID: References: <4B2741961D3F4053AD4A3F6A195E2371@gmail.com> <07DD5A5D889944F7B10E983AF5776A6D@gmail.com> User-Agent: Alpine 2.01 (LNX 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed On Sat, 28 Apr 2012, TJ Luoma wrote: > > > On Saturday, April 28, 2012 at 4:54 PM, Benjamin R. Haskell wrote: > >> My config currently spans 19 files, so my bias should be apparent. I >> keep everything in ~/.zsh/, except for machine-specific settings, which >> I put in ~/.zsh.local/. And ~/.zshenv is a symlink to ~/.zsh/.zshenv, >> which sets ZDOTDIR to ~/.zsh. My ~/.zsh/.zshrc sources the other files >> in ~/.zsh/, most of which have some guard at the top (e.g. >> ~/.zsh/.zsh_screen returns if the `screen` command isn't installed). > > Ok, now I'm curious: > > 1. What are the 19 files? Functions in one, aliases in another, > variables in another? I can't even imagine that many different files, > but maybe I'm missing something. Note that I didn't say my bias was "correct", only "apparent". ;-) It's mostly from inertia that I still keep my config in that many files, but here they are (I miscounted -- only 18): .zsh_aliases - one-liners: aliases, hash -d, some tiny functions .zsh_checkconfig - alerts me when certain commands/non-zsh configs are missing (e.g. .screenrc) .zsh_colors - (obsolete) sets some vars to contain VT100 escape sequences .zsh_completion - completion-system-specific configuration .zsh_functions - functions of >1 line, simple perl scripts .zsh_history_setup - history-related options .zsh_im - sets up X11 Input Method (IM) .zsh_locale - my locale settings (en_US.UTF-8 except LC_COLLATE=POSIX) .zsh_make_backups - backs up my .historyfile and a few other files daily .zsh_math - (rarely used) some small functions/vars relating to math .zsh_nosefart - small functions for nosefart (an NES sound file player) .zsh_prompt - sets up my prompt (lots of custom functions) .zsh_screen - some functions and aliases for using screen/dtach .zsh_ssh - set up my SSH agent .zsh_ssh_logip - log my IP if logging in via SSH .zsh_svn_backup - (obsolete - from when I was using SVN rather than git) .zshenv - environment variables, paths, etc. .zshrc - command_not_found_handler, env vars that only make sense interactively ($LESS, $PAGER, $EDITOR), general Zsh settings, loads the other files (including things in .zsh.local, if it exists) > 2. Are you primarily using one computer or several? If several, how > do you keep this in sync? I generally have a work PC and a home PC. I keep both of those configs in git, occasionally cherry-picking things from the work repo into my home repo. For systems where I won't likely make many modifications, I generally just rsync to the remote system. Then custom things go in .zsh.local (e.g. .zsh.local/.zsh_prompt always contains a custom prompt color). For small synchronization tasks, I use a function that calls vimdiff on the local and remote files. > FWIW my ~/.zshenv and ~/.zshenv are links to ~/Dropbox/etc/Zsh/env.sh > and ~/Dropbox/etc/Zsh/rc.sh but I have some shell accounts which I > can't sync via Dropbox so I end up syncing them manually (scp) and it > always seems like one file would be easier there too. OTOH I suppose > rsync would be easy enough. Yeah. At the rate I make modifications (infrequently, and usually in batches), I find it's easy enough to just: rsync -av ~/.zsh remote-machine: -- Best, Ben