From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26749 invoked by alias); 22 Jan 2015 12:57:24 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19762 Received: (qmail 19438 invoked from network); 22 Jan 2015 12:57:20 -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.6 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=WskVI02Sf7Ma2b0G70XkFraXmqzJVzGcp0fuVObN8To=; b=MSo9DuPVKAXxSJxoWHLiUFgA/ananwrkL76FEBsWS0bVHqN8Oe2KUhJlClk4dTwcFH Eu/FEhROQFW0YH3DmvBjcOjA4lo9Pt3UTnZAlPf8OW8h4ShALN3oQnpygOKBdyEZrx5p bMWfS9pxYSLjbH7fK2yqKx2+35Jqjx+z0H0+sYc7099dpMwbFIhbCBxjJzZaKEZvWaFv AIkHLtPXLbvWMpV1+NWpyYgQv5flvEa/794FMeGErzwWneDrU+l41ArvyRHQcnrzmDof GpBeTHGSKrYIOorlYcrUPJuEiZVPoOYhbLB1yo4zAyGH45L/zoCavNvQ7Flswiq9gyVE QoFA== X-Gm-Message-State: ALoCoQnmrW4ENS/V8J8tiFMCY5yV3R0+Lbrkwl6Wl0MT3nhlFc6pAZQveIgJ+PsJbfpNvMSuu6Tt MIME-Version: 1.0 X-Received: by 10.152.88.4 with SMTP id bc4mr1373468lab.5.1421931433197; Thu, 22 Jan 2015 04:57:13 -0800 (PST) X-Originating-IP: [80.239.194.50] In-Reply-To: References: Date: Thu, 22 Jan 2015 12:57:13 +0000 Message-ID: Subject: Re: refering to 2nd from last history parameter? From: Peter Stephenson To: zsh-user Content-Type: multipart/alternative; boundary=001a11c365b4f893b1050d3d350e --001a11c365b4f893b1050d3d350e Content-Type: text/plain; charset=UTF-8 On Thu, 22 Jan 2015 12:18:19 +0000 zzapper wrote: > I don't think it's possible > > ls !$ last parameter of previous command > > echo a b c d e f g h > > I don't think I can grab 'g' without counting left to right This isn't actually a question :-). What are you trying to do? Are you at the shell command line trying to extract something and don't care if you use the editor or history, but happen to know there was a way to do something a bit like this in the history? I'll assume that but let us know if that's not the case. You can use the insert-last-word standard widget (\e. in Emacs mode) combined with the copy-earlier-word shell widget, which I have bound as autoload -Uz copy-earlier-word zle -N copy-earlier-word bindkey '\e=' copy-earlier-word Then the answer is that you type "\e." to get the h then "\e=" to go back to the "g". I use this all the time. pws --001a11c365b4f893b1050d3d350e--