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

Re: Fw: Zsh - push current command on history without executing it



>>>>> "zzapper" == zzapper  <david@xxxxxxxxxx> writes:

    zzapper> Casper Gripenberg wrote in news:477E177A.3060303@xxxxxxxxxxxxx:
    >> Mikael Magnusson wrote:
    >> > [...]
    >>> And I have this custom widget to help me store a command line
    >>> in history without executing it:
    >>> 
    >>> commit-to-history() {
    >>> print -s ${(z)BUFFER}
    >>> zle send-break
    >>> }
    >>> zle -N commit-to-history
    >>> bindkey "^X^H" commit-to-history
    >>> 
 
    zzapper> Good one, BTW you can use this as a temporary memory for
    zzapper> a telephone number etc etc as well etc.

    zzapper> I seem to have trouble with double letter bindkeys , or
    zzapper> is this the old vi- edit mode problem?

I use a pretty simple method, I just put echo in front of the string
I like to save and execute that line.  Then it will be in the history.
I can search for these by back search the echo like:

    echo<M-p>

Pretty easy.



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