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

Two



"^R" history-incremental-search-backward  is probably the command I use 
most frequently in Zsh (behind "^J" accept-line).  But, recently there are 
two quirky traps that I've found myself falling into.

The first is that I've been switching between systems more frequently, so 
things that I've recently typed (or frequently type) aren't necessarily in 
my history on a given box.  It'd be nice to be able to go from:

$ (etc etc etc ... some partial match ... etc etc etc)
failing bck-i-search: some commandli_

to:

$ some commandli


(i.e. the failing search becomes the current command line.)  Is there 
something like that in place already?  If not, what would be the best 
place to start tinkering?


The second is simpler and similar.  Sometimes I just want to look back in 
history for some clue as to the syntax of a command.  (Read: every time I 
use mencoder.  Oy.)  What's the best way to:

1. Have some command partially entered
2. Do some reverse search
3. Return to the partial command, with the search "result" still visible

Out of long-ingrained habit, I tend to:

1. ^A Go to start of line
2. ^K Kill the line
3. ^R (some-search) Do some search
4. ^F Move forward a character (to prevent losing the "result" on-screen)
5. ^C Cancel the search
6. ^Y Yank the killed line

I suspect there's a way to combine #1 and #2, and it'd be nice if #4 and 
#5 were unnecessary due to a better way to do #6.

Best,
Ben



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