From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16298 invoked by alias); 25 Feb 2012 20:47:00 -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: 16793 Received: (qmail 24585 invoked from network); 25 Feb 2012 20:46:48 -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=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at mi.fu-berlin.de does not designate permitted sender hosts) Date: Sat, 25 Feb 2012 21:30:33 +0100 From: "Christoph (Stucki) von Stuckrad" To: zsh-users@zsh.org Cc: Moritz Bunkus Subject: Re: s/pattern/pattern/g on the commandline ? Message-ID: <20120225203017.GK7932@localhost.mi.fu-berlin.de> Mail-Followup-To: zsh-users@zsh.org, Moritz Bunkus References: <20120225182450.GA31597@solfire> <20120225192409.GA65335@redoubt.spodhuis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120225192409.GA65335@redoubt.spodhuis.org> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: "Chr. von Stuckrad" X-Remote-IP: 160.45.113.41 X-Spam_Score: -2.9 X-exim-Spam_Score_Int: -28 X-exim-Spam_Bar: -- X-Spam_Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay * domain * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] X-Originating-IP: 160.45.117.149 On Sat, 25 Feb 2012, Phil Pennock wrote: > Then pressing esc-v will invoke $VISUAL (else $EDITOR, else vi) as a > text-editor for adjusting the current command-line. So and then > -v will let you do as much as you need. > > Be careful to not suspect the text-editor, only save and exit when > you're done. Same thing, if you've not yet bound the key, can be done by 'fc' command. Even more: if I notice I'll use the same things a few times soon, I often do 'fc -# -1' (with '#' some *number* of lines back) putting the last '#' number of lines into the editor at once. Then e.g. put an 'doit() {' as first line, '}' as last, and edit the repeated lines into something with '${1}' instead of the 'part to edit'. Writing it back makes it into function 'doit' and I'll need not worry about editing the right thing, just give the new as parameter. The complete function will stay 'in one line of history', so I can even repeat editing, if need be, or can be re-edited with 'zed -f doit'. Stucki -- Christoph von Stuckrad * * |nickname |Mail \ Freie Universitaet Berlin |/_*|'stucki' |Tel(Mo.,Mi.):+49 30 838-75 459| Mathematik & Informatik EDV |\ *|if online| (Di,Do,Fr):+49 30 77 39 6600| Takustr. 9 / 14195 Berlin * * |on IRCnet|Fax(home): +49 30 77 39 6601/