From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69 invoked from network); 28 Oct 2005 11:48:26 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 28 Oct 2005 11:48:26 -0000 Received: (qmail 90006 invoked from network); 28 Oct 2005 11:48:20 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 28 Oct 2005 11:48:20 -0000 Received: (qmail 3729 invoked by alias); 28 Oct 2005 11:48:13 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9580 Received: (qmail 3720 invoked from network); 28 Oct 2005 11:48:13 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 28 Oct 2005 11:48:13 -0000 Received: (qmail 89033 invoked from network); 28 Oct 2005 11:48:13 -0000 Received: from her-isrv.ionific.com (195.197.252.67) by a.mx.sunsite.dk with SMTP; 28 Oct 2005 11:48:12 -0000 Received: from her-gw.ionific.com ([195.197.252.66] helo=trews52.bothi.fi) by her-isrv.ionific.com with esmtp (Exim 3.35 #1 (Debian)) id 1EVSiR-0004J1-00 for ; Fri, 28 Oct 2005 14:48:11 +0300 Received: from azure by trews52.bothi.fi with local (Exim 3.36 #1 (Debian)) id 1EVSiH-0006pZ-00 for ; Fri, 28 Oct 2005 14:48:01 +0300 To: zsh-users@sunsite.dk Subject: Re: Simple Tip of the Day Mail-copies-to: nobody From: Hannu Koivisto Date: Fri, 28 Oct 2005 14:47:51 +0300 In-Reply-To: (zzapper's message of "Fri, 28 Oct 2005 12:11:53 +0100") Message-ID: <87ek65zwuw.fsf@trews52.bothi.fi> User-Agent: Gnus/5.090014 (Oort Gnus v0.14) Emacs/21.4 (i386-pc-linux-gnu) References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: Hannu Koivisto X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) 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.0.4 zzapper writes: > bindkey -M viins '^O' copy-prev-word > > "^O" copy-prev-word > > allows me to type say > >> cp longfilename.tex ^O >> cp longfilename.tex longfilename.tex > which I then modify Wouldn't copy-prev-shell-word be even more useful for that purpose? It handles things like cp filename\ with\ spaces.txt ^O > Your most useful binding? Hmm, I can't name just one. But I couldn't imagine using zsh without the following: bindkey '^[[A' history-beginning-search-backward # "Up" bindkey '^[[B' history-beginning-search-forward # "Down" bindkey -s '^[[5~' 'cds\r' # "PageUp" Just in case you are wondering what that 'cds' is, it is an interactive way to select a directory from the directory stack-treated-as-history, along the lines of a similar feature in 4nt: cds () { local DIR="$PWD" if [[ ! -z "$dirstack" ]]; then DIR=$(print -rl $dirstack | tac \ | iselect -a -f -n chdir -Q "$PWD" -t "Change directory to..." -p ${#dirstack}) fi cd "$DIR" } As you can see, it requires 'iselect' utility that is available as a Debian package, for example. (I wish I could implement an iselect replacement using only zsh/zle.) Also, in order to be useful it requires you to setopt auto_pushd. I also setopt pushd_ignore_dups and set DIRSTACKSIZE to a reasonably large value. -- Hannu