From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25068 invoked from network); 24 Nov 2008 22:33:52 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 24 Nov 2008 22:33:52 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 86454 invoked from network); 24 Nov 2008 22:33:40 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 24 Nov 2008 22:33:40 -0000 Received: (qmail 17726 invoked by alias); 24 Nov 2008 22:33:23 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13485 Received: (qmail 17714 invoked from network); 24 Nov 2008 22:33:23 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 24 Nov 2008 22:33:23 -0000 Received: from elation.princeton.edu (elation.Princeton.EDU [128.112.144.224]) by bifrost.dotsrc.org (Postfix) with ESMTP id 7CA0A80525B4 for ; Mon, 24 Nov 2008 23:33:19 +0100 (CET) Received: from [192.168.2.18] (unknown [71.240.125.205]) by elation.princeton.edu (Postfix) with ESMTP id 2126E1E00ADF1; Mon, 24 Nov 2008 17:29:45 -0500 (EST) Date: Mon, 24 Nov 2008 17:33:28 -0500 (EST) From: "Benjamin R. Haskell" To: Zsh Users Subject: Re: Zsh configuration files In-Reply-To: Message-ID: References: <2d460de70811230730v1a79f3b3rd73a020f99b66f02@mail.gmail.com> User-Agent: Alpine 2.00 (LNX 1169 2008-08-27) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463807486-1937392752-1227563503=:20698" Content-ID: X-Virus-Scanned: ClamAV 0.92.1/8676/Mon Nov 24 20:12:57 2008 on bifrost X-Virus-Status: Clean This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463807486-1937392752-1227563503=:20698 Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT Content-ID: On Sun, 23 Nov 2008, Maurí­cio wrote: >>> I've just started using zsh in two computers. I >>> configured zsh in one of them and copied .zshrc >>> and .zcompdump to the other. However, the prompt >>> in the second is different from the first. Are >>> there other configuration files I forgot to >>> copy? >> >> Define different. If one has bold colors where the >> other has light colors, it's a implementation detail >> of the terminal emulator. >> >> Most notably at the moment, Konsole 1.x (KDE 3) >> employs lighter colors while Konsole 2.x (KDE 4) >> uses bold. Bold is correct, but many terminals >> don't adhere to that. >> > > Nothing important, just the prompt in the second > computer shows no information (current directory > etc.). > > What matters to me is that, since I keep my > configuration under version control, I would like > to be sure everything in my user configuration is > there. If something remains wrong, I'll try to fix. > > Thanks, > Maurício Hi Maurício -- Nice to see you here. Long ago, I set some things up for easily sharing my Zsh startup scripts between various computers I use. I did most of this when I was still fairly new to Zsh, so some things might have easier/better ways to do them, but this is how I set mine up. Some features: 1. Automatically runs any files matching .zsh_* in my home dir, excluding vim swap files 2. For running as root, I can just link my normal-user .zshrc and .zshenv files, and it'll detect that they're linked, and use the .zsh_* files from my normal-user directory 3. To override things in the .zsh_* files, I also have .zsh_*- files. (e.g. .zsh_prompt, for general prompt setup, and .zsh_prompt- for system-specific) 4. On some systems, I don't have 'list' access to my actual home dir until I get my AFS tokens, so I read the list of .zsh_* files from ~/.ZSHFILES Here's the section from my .zshrc that handles all this: ##### at the end of my .zshrc ##### # three dirs to check by default dirs=(~/.zsh-scripts ~ ~/.zsh-scripts-) # if this .zshrc is a symlink, use its directory, too SCRIPT=${(%)${:-%N}} if [ -L $SCRIPT ] ; then SCRIPT=$(readlink $SCRIPT) dirs+=($SCRIPT:h) fi for dir in $dirs ; do [ ! -d $dir ] && continue setopt nullglob pushd $dir files=(.zshrc-) if [ -f .ZSHFILES ] ; then files=($files `cat .ZSHFILES`) else files=($files *zsh_*~*.swp~*.zsh_history) fi for file in $files ; [ -r $file ] && source $file popd setopt nonullglob done ##### .zshrc ##### So, in my Mercurial repository, I have the following files: .zsh_aliases .zsh_aliases- .zsh_bluetooth- .zsh_colors .zsh_completion- .zsh_functions .zsh_functions- .zsh_gpg- .zsh_history_setup .zsh_locale .zsh_make_backups- .zsh_math .zsh_prompt .zsh_prompt- .zsh_screen .zsh_ssh .zsh_svn_backup .zshenv .zshenv- .zshrc .zshreminder But, I only really keep these versioned for my 'main' computer. For any other computers I use, I have a script that packages up the ones that aren't machine-specific and dumps it onto my web server. So, when I start using Zsh on a new computer I can do: wget -O - http://benizi.com/zsh.tbz2 | tar -jxvf - # (Nothing sensitive -- that's the actual URL.) .screenrc .vimrc .zsh_aliases .zsh_colors .zsh_functions .zsh_history_setup .zsh_locale .zsh_math .zsh_prompt .zsh_screen .zsh_ssh .zshenv .zshrc Usually the only thing I immediately add is: echo 'PSCOLOR=$BLUE' > ~/.zsh_prompt- (I find it helpful to have different machines' prompts colored differently. PSCOLOR is something used in .zsh_prompt) (Maurício -- The functions I mentioned on the mlterm list are spread across .zsh_prompt and .zsh_colors ) Best, Ben ---1463807486-1937392752-1227563503=:20698--