Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: how to clean a history entry?



I wouldn't mind hearing additional ideas on finding previous history
lines.  Some of the widgets  that exist now could be improved (like
incremental search, and "infer"ing, )
I've started a rough draft of some ideas I've had about improving
incremental search on the wiki:
http://zshwiki.org/ImprovedIncrementalSearch

The "infer" widgets seem ripe for improvement.  Currently those
widgets only use one simple strategy based on the previous history
line.   There are several other simple schemes that could be used for
inferring lines from the history (e.g. inferring based on a deeper
matching into history, or searching a previously primed area of
history or a file, looking further back for other matches.)  Also, the
infer widgets could build a list of possible choices that  be cycled
through.
 
Also maybe mechanisms to make automatic edits to previous command
lines to make new commands lines that are wanted.  With incremental
search and inferring you have two history lines, the one that is
found, and the one that is actually "accept"ed.  With two lines it is
possible to look at the difference and maybe infer a likely edit, or
at least where the user might want to edit.

-FR. 


On Tue, 4 Jan 2005 13:03:01 -0800, Wayne Davison
<wayned@xxxxxxxxxxxxxxxxxxxxx> wrote:
> On Tue, Jan 04, 2005 at 06:40:10PM +0000, Peter Stephenson wrote:
> > Might not be difficult to add as a feature, since internally history
> > is held as a linked list.  I can certainly see the use in it when
> > you're reexecuting chunks of the history.
> 
> The basic idea would be quite easy to implement, but it gets a little
> more complicated if the user is using an option such as SHARE_HISTORY
> since the history item might have already made its way into other shell
> instances through the shared history file.  I suppose just making the
> current shell dump the line and then re-writing the history file to
> remove the line would be a good enough first implementation, though (as
> the user could manually deal with any propagation of the command).
> 
> And, as long as I'm talking about history-related items, it would be
> nice to brain-storm some ideas on how to improve the recall of desirable
> prior commands.  I tend to use HIST_IGNORE_SPACE and an absurd amount of
> leading-space commands to keep my history list limited to mainly just
> the commands that I think I will need to re-run.  I also use the kill
> ring and Ctrl-Q to remember various commands that I need to re-run in
> the near term, but that I don't want to get in the way of my use of
> Ctrl-R to find prior well-used commands.  This means that I tend to
> inconvenience myself by needing to take extra steps to re-run less-used
> commands, and that I don't use word-delete much at all.
> 
> It would be nice to improve on this somehow (perhaps via options that
> I'm not aware of) so that the history could go back to being a list of
> all the (non-sensitive) commands I typed and still allow me to find my
> favorite commands easily.  Perhaps some sort of a "bookmark" system that
> allows me to store off and recall my most favorite commands.  Or perhaps
> a way to search through the history in most-used order (in addition to
> most-recent order) so that a recently-run rsync command doesn't get in
> the way of my most-used rsync commands (unless I want it to).  It would
> be nice to have a way to specify user-selectable matching for commands
> that should not be stored.  Perhaps even a rewriting system that could
> let a command be stored, but with its sensitive info XXXed out (allowing
> the user to re-run it by just re-inserting the missing info).  And an
> option to expire the history list based on LRU order might be good too.
> 
> Does any of that sound good?  Am I missing some existing zsh features?
> Any other ideas for how to make command-reuse easier?
> 
> ..wayne..
>



Messages sorted by: Reverse Date, Date, Thread, Author