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

Re: zshzle: aborting history search



On Sat, 17 Jul 2004, Georg Neis wrote:

> "bck-i-search: cat /fo" turns into "failing bck-i-search: cat /fo" 
> because the command is (for whatever reasons) not in my history file. 
> Now I want to [move] "cat /fo" from the search prompt to the normal 
> command prompt

copy-search-as-buffer() { zle end-of-history; BUFFER="$LASTSEARCH" }
zle -N copy-search-as-buffer
bindkey '\ee' copy-search-as-buffer

Choose your own binding in place of escape-e, I just picked something that 
isn't bound by default.  The "end-of-history" isn't strictly necessary, 
but it means you aren't left with a modified buffer in the middle of the 
history after the first part of the incremental scan.



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