From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12902 invoked from network); 25 Mar 2002 15:47:00 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 25 Mar 2002 15:47:00 -0000 Received: (qmail 13546 invoked by alias); 25 Mar 2002 15:46:38 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4774 Received: (qmail 13530 invoked from network); 25 Mar 2002 15:46:36 -0000 From: "Bart Schaefer" Message-Id: <1020325154622.ZM31551@candle.brasslantern.com> Date: Mon, 25 Mar 2002 15:46:21 +0000 In-Reply-To: <20020325114508.A723@nymos.home.hr> Comments: In reply to Marijan Peh "My zshrc; any sugestions welcome" (Mar 25, 11:45am) References: <20020325114508.A723@nymos.home.hr> X-Mailer: Z-Mail (5.0.0 30July97) To: Marijan Peh , zsh-users Subject: Re: My zshrc; any sugestions welcome MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 25, 11:45am, Marijan Peh wrote: } } Any sugestions welcome, thanks. Oh, what the heck, I've got half an hour to waste. ---------- ## [[ ${+*} -eq 0 ]] = if variable is set don't set it anymore [[ ${+USER} -eq 0 ]] && export USER=$USERNAME You can write this as (( ${+USER} )) || export USER=$USERNAME Or even as export USER=${USER:-$USERNAME} ---------- ## display user@host and name of current process in (xterm|rxvt) title preexec () {print -Pn "\033]0;%n@%m [$1] %~\007"} It'd probably be better to use ${${(z)1}[1]} there, rather than $1, if you want just the command name. Or even ${${${(z)1}:#*[[:punct:]]*}[1]} in case the first "word" is an open-paren or something. ---------- function compstyle { } You meant `function zstyle { }', I'll bet. It hasn't been called compstyle for a while now. ---------- alias x='startx & disown && exit' You can write that as alias x='startx &! exit' so that `disown' can't accidentally disown the wrong job. ---------- [in pskill()] kill -9 `print -r $pid` Any reason why that isn't just `kill -9 $pid'? ---------- ## invoke this every time when u change .zshrc to ## recompile it. src() { ! [ -f ~/.zshrc.zwc ] && zcompile ~/.zshrc ! [ -f ~/.zcompdump.zwc ] && zcompile ~/.zcompdump autoload zrecompile [ -f ~/.zshrc ] && zrecompile ~/.zshrc [ -f ~/.zcompdump ] && zrecompile ~/.zcompdump [ -f ~/.zshrc.zwc.old ] && rm -f ~/.zshrc.zwc.old [ -f ~/.zcompdump.zwc.old ] && rm -f ~/.zcompdump.zwc.old source ~/.zshrc } You should be able to get rid of those first two zcompile lines; just change the two zrecompile lines to be: [ -f ~/.zshrc ] && zrecompile -p ~/.zshrc [ -f ~/.zcompdump ] && zrecompile -p ~/.zcompdump ---------- ## restore all .bak files ## call this with something like: restore_bak 'find . -name "*.bak"' restore_bak () { foreach f ($argv); mv $f ${f%%.bak}; end } No problem with that (portability back to 3.0, etc.), but in 4.0: autoload -U zmv zmv '(**/)(*).bak' '$1$2' ---------- [in readme()] In 4.0 with extendedglob you can write that files assignment as files=(./(#i)*(read*me|lue*m(in|)ut)*(ND)) ---------- That's all. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net