Zsh Mailing List Archive
Messages sorted by:
Re: Editing history stack during runtime?
- X-seq: zsh-users 12661
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: "zsh users" <zsh-users@xxxxxxxxxx>
- Subject: Re: Editing history stack during runtime?
- Date: Fri, 29 Feb 2008 08:43:10 -0800
- In-reply-to: <2d460de70802281709n1847611cp6cb9a5273e212bae@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <2d460de70802281709n1847611cp6cb9a5273e212bae@xxxxxxxxxxxxxx>
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.
Messages sorted by: