From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11166 invoked by alias); 14 Jul 2014 02:09:00 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 32859 Received: (qmail 10368 invoked from network); 14 Jul 2014 02:08:42 -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=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=X2r+54GcTE0nGt5H1qtNJdgFOkmqxqkgJxl/A9ZnJYk=; b=Mt4/yAfsboEOiVTHBD45+cgzHM8JnNLwl2PplAHvCB8p2g1NIPleZOKfGnciFRAR3q h/2T/1cX1TCQ+fWyzzYvOWzJuQqB1gm1xJ2uHfyIy4Q99unxGugguHXcgORGkIqSQ9Ld fT1JYEOw8+VQlBZzn+l0AhIyYXPStlftvN2/7lXl7WLC60/1nOFKLqJAXkiqxQJa5L7v w3GQ6Mttw1HZswS/DlMzXV7L595C6glZW/rvsfj5jOUGrYqF6rasxomPJPOUl7C+tJcE Aeqlcy2A0/IA5teD2GHrQEIYpf78RiJcbd+v5x+YvAsYpRCU5cn7ql9FO8Pgf0oiwP0j dzZA== MIME-Version: 1.0 X-Received: by 10.140.47.129 with SMTP id m1mr8704553qga.95.1405303718444; Sun, 13 Jul 2014 19:08:38 -0700 (PDT) In-Reply-To: <87sim427ra.fsf@debian.uxu> References: <874myk3ocp.fsf@debian.uxu> <87sim4lwxk.fsf@ft.bewatermyfriend.org> <87sim427ra.fsf@debian.uxu> Date: Mon, 14 Jul 2014 04:08:38 +0200 Message-ID: Subject: Re: implicit previous command, only state what should change From: Mikael Magnusson To: Emanuel Berg Cc: zsh workers Content-Type: text/plain; charset=UTF-8 On 14 July 2014 00:50, Emanuel Berg wrote: > Frank Terbeck writes: > >>> $ grep user-home-directory *.el >>> >>> After that, I realize that it should have been >>> `user-emacs-directory'. >>> >>> Is there a way to tell zsh to "execute the previous >>> command again, only substitute the first argument for >>> user-emacs-directory"? Like >>> >>> $ !!:1->user-emacs-directory >> >> Like this: >> >> % ^-home-^-emacs- > > I seems that is substitution of the first match sort of > like the sed substitution command without the g option, > which actually for this example is much better than my > suggestion (because only part of the argument is > incorrect), so it is great to know, yes. > > Still, one can imagine a case when the whole argument > is wrong, and for a long argument it would be better to > just be able to refer to it and state the replacement. > > I tried ^!:1^replacement but that wasn't it. > > -- > underground experts united I would just navigate to the line and word, delete-whole-word-match, and type the new argument there. (You'll need to autoload, zle -N and bindkey that to something). -- Mikael Magnusson