zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: "zsh users" <zsh-users@sunsite.dk>
Subject: Re: Editing history stack during runtime?
Date: Fri, 29 Feb 2008 08:43:10 -0800	[thread overview]
Message-ID: <080229084310.ZM17549@torch.brasslantern.com> (raw)
In-Reply-To: <2d460de70802281709n1847611cp6cb9a5273e212bae@mail.gmail.com>

On Feb 29,  2:09am, Richard Hartmann wrote:
}
} is there a way to stuff all my local history (i.e. from from hist files)
} into $EDITOR, edit it and put back whatever I save to it?

There are a couple of different things you might mean by this, so I'm
not sure how to answer.  Does "put back" mean "keep in $HISTFILE" (for
the next shell that starts) or does it mean "load immediately"?  And
does "local history" mean "most current history of this shell" or does
it simply mean whatever is in $HISTFILE at the moment?

If you don't have INC_APPEND_HISTORY set and you want the most recent
history of the current shell, you need to write the file first with
"fc -W".  That might get into complications if SAVEHIST and HISTSIZE
have different values.

Then you can simply run "$EDITOR $HISTFILE", and finally re-read it
with "fc -R".  However, if you have SHARE_HISTORY set, then editing
the file in place may not be a good idea, so there's no way to give
you a direct answer without knowing what end result you want.

Then there are the added complications of EXTENDED_HISTORY, which puts
things in $HISTFILE you have to be careful about editing (it's still
all just text, though).  You can arrange to strip those so that you
can edit without breaking anything, but then when you rewrite the file
you'll lose all that information.

So ... if this doesn't tell you enough to get where you want to be,
you're going to have to ask a more specific question.


  reply	other threads:[~2008-02-29 16:44 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-29  1:09 Richard Hartmann
2008-02-29 16:43 ` Bart Schaefer [this message]
2008-02-29 19:42   ` Richard Hartmann
2008-03-01  3:22     ` Bart Schaefer
2008-03-01 10:38       ` Richard Hartmann
2008-03-01 12:59         ` Bart Schaefer
2008-03-03 12:25           ` Richard Hartmann
2008-03-03 16:30             ` Bart Schaefer

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=080229084310.ZM17549@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@sunsite.dk \
    /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).