From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9291 invoked from network); 22 May 2000 00:45:39 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 22 May 2000 00:45:39 -0000 Received: (qmail 5541 invoked by alias); 22 May 2000 00:45:22 -0000 Mailing-List: contact zsh-users-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 3074 Received: (qmail 5530 invoked from network); 22 May 2000 00:45:21 -0000 From: "Bart Schaefer" Message-Id: <1000522004505.ZM11820@candle.brasslantern.com> Date: Mon, 22 May 2000 00:45:05 +0000 In-Reply-To: <20000522010726.A3301@fruitcom.com> Comments: In reply to Eric Smith "commandline "macro"" (May 22, 1:07am) References: <20000522010726.A3301@fruitcom.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Eric Smith , zsh users Subject: Re: commandline "macro" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On May 22, 1:07am, Eric Smith wrote: } Subject: commandline "macro" } } Is there a way to map to a key combination certain strings that then come } up on the command line? You may then further edit whatever appears. Look at "bindkey -s ...". } Similiar to searching your history file and having a previous command } come up but in this case the commands are stored in your rc file. If you mean you want to have a set of keystrokes that lets you scroll through a list of commands and choose one to edit, you're probably best off making use of the new completion system in (soon-to-be) 3.1.7. Something like this, which you name whatever you want and put into a directory in $fpath so compinit will see it: ---- 8< ---- snip ---- 8< ---- #compdef -k menu-complete ^X: local -a commands commands=(${(f)"$(cat)"}) <<\EOF echo Put any commands you like here, echo as long as they don\'t need embedded newlines. : 'This is a hack because a here-document does not work in $(...),' : in fact it puts the parser into state from which it can never : correctly return. EOF compadd -Q "$commands[@]" ---- 8< ---- snip ---- 8< ---- Now you can type ^X: and then TAB your way through the commands, or set up styles to start menu-selection, or whatever. It does beep a lot when I try it, for reasons I'm too heat-oppressed to figure out just now (Sven?), but it works. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com