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

Re: history menu completion?



Hi, here is what I do to achieve what you want.

I bound history-beginning-search-forward to F2 and
history-beginning-search-backward to F3.

Then, when I type a command that I want to recall from history, I simply
type enough to match the history (usually just the command without any
parameters) then press F2 or F3 to cycle through all the history matches
for that command.

Example.
$ somecom<F2> matches
$ somecommand -with -fancy /options/and/a/long/path

but the cursor stays in place and you can press F2 again and it will
match:
$ somecommand -with -more -fancy /options/and/another/long/path
and so on...

I read about it a while back on this list and it has changed my life.
:-)


Darren.


On Fri, Aug 16, 2002 at 06:51:57PM -0500, vts@xxxxxxxxxxxxxxxxxxxx wrote:
> 
> Here is a scenario:
> 
> $ somecommand -with -fancy /options/and/a/long/path
> $ somecommand -with -more -fancy /options/and/another/long/path
> .
> 
> Now, if I do:
> 
> $ !somecom<TAB>
> 
> I'll get the following
> 
> $ somecommand -with -more -fancy /options/and/another/long/path
> 
> At this point, I would like to be able to hit <TAB> again to get:
> 
> $ somecommand -with -fancy /options/and/a/long/path
> 
> the same way it works for ambiguous filename completion.  Searches
> have failed me: Is there a way to do this with zsh?
> 
> If not, there should be!
> 
> 
> 

-- 
Burns:    Who was that young hellcat, Smithers?
Smithers: Homer Simpson, sir.
Burns:    Simpson, eh?  I'll remember that name...
Darren Greaves <darren@xxxxxxxxxxxxx> - http://boncey.org/



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