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

Re: How to kill string but leave it in history?



On Jan 16,  4:37pm, Zefram wrote:
} Subject: Re: How to kill string but leave it in history?
}
} Roderick Schertler wrote:
} >Which reminds me, it has always bugged me that if zsh creates a
} >continuation line (like
} >
} >    $ print "foo<return>
} >    dquote> _
} >
} >) I can't go from the dquote> line back up to the first line
} 
} Yes, this is what push-input is for.

Or push-line-or-edit, which acts like push-line at the PS1 prompt, but
at the PS2 prompt acts like push-input followed by get-line.  (Saves
some vertical space and one or two keystrokes.)

In answer to the original query, this *ought* to work, and does if you
type the keystrokes by hand:

bindkey '\eq' push-line-or-edit
bindkey -s '^X^H' '\eq\e< print -s ^@\e>\e"^M'

For some reason, though, the right-hand-side of the ^X^H binding stops
as soon as either of push-input or push-line-or-edit is executed.  I.e.,
the binding above acts like "bindkey -s '^X^H' '\eq'" -- all the trailing
stuff is dropped.  I presume that's a bug in push-input ....

-- 
Bart Schaefer                             Brass Lantern Enterprises
http://www.well.com/user/barts            http://www.nbn.com/people/lantern



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