zsh-users
 help / color / mirror / code / Atom feed
From: "Christoph (Stucki) von Stuckrad" <stucki@math.fu-berlin.de>
To: zsh-users@zsh.org
Cc: Moritz Bunkus <moritz@bunkus.org>
Subject: Re: s/pattern/pattern/g on the commandline ?
Date: Sat, 25 Feb 2012 21:30:33 +0100	[thread overview]
Message-ID: <20120225203017.GK7932@localhost.mi.fu-berlin.de> (raw)
In-Reply-To: <20120225192409.GA65335@redoubt.spodhuis.org>

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 <up> and then
> <esc>-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 <stucki@mi.fu-berlin.de> \
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/


  reply	other threads:[~2012-02-25 20:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-25 18:24 meino.cramer
2012-02-25 18:35 ` Jérémie Roquet
2012-02-25 18:41   ` Jérémie Roquet
2012-02-25 18:46     ` Moritz Bunkus
2012-02-25 19:03       ` Damien Thébault
2012-02-25 19:19         ` Jérémie Roquet
2012-02-25 19:36           ` Moritz Bunkus
2012-02-25 19:24       ` Phil Pennock
2012-02-25 20:30         ` Christoph (Stucki) von Stuckrad [this message]
2012-02-26 18:32       ` Bart Schaefer
2012-02-27  3:14         ` Darryl Zurn
     [not found]     ` <20120226075234.GB3020@solfire>
2012-02-26 15:17       ` Jérémie Roquet
     [not found]     ` <20120227041300.GA3063@solfire>
2012-02-28 13:09       ` Jérémie Roquet
2012-02-29 13:48         ` Christoph (Stucki) von Stuckrad
2012-02-29 15:55           ` Bart Schaefer
2012-02-27 10:38 ` Peter Stephenson
2012-03-29 12:06   ` Vincent Lefevre
2012-03-29 20:23     ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120225203017.GK7932@localhost.mi.fu-berlin.de \
    --to=stucki@math.fu-berlin.de \
    --cc=moritz@bunkus.org \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).