[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [eev] `ee' with history
From: |
Eduardo Ochs |
Subject: |
Re: [eev] `ee' with history |
Date: |
Sun, 6 Apr 2008 03:22:50 -0300 |
Hi Xavier,
> > Hi,
> >
> > I redefined `ee' to place the contents of $EE in the history list.
> >
> > function ee () { set -v; print -s -f "%s" "`cat $EE`"; . $EE $*; set +v; }
>
> I am late on this but how do I use it ? Where should I put this ?
> Is this part of the official eev package (now) ?
"print -s" is a zshism... see:
(find-node "(zsh)Shell Builtin Commands" "\nprint" "-s")
It says: "-s: Place the results in the history list instead of on the
standard output."
I prefer to keep the old "ee" and Rubikitch's trick in two separate
functions:
# See:
# http://angg.twu.net/.zshrc.html#ee
# http://angg.twu.net/.zshrc.html#eeh
# http://angg.twu.net/.zshrc.html#hh
function ee () { set -v; . $EE$*; set +v; }
function eeh () {
print -s -f "%s" "$(cat $EE)";
echo "(Added to history:)";
cat $EE;
}
When I type "eeh" on a zsh prompt the contents of the $EE file are
pushed into the history instead of executed - and then by using <up> I
can edit them at the shell prompt, and using "hh" I can save the last
commands in the history to a temporary file that I can edit in
Emacs...
I am not planning to make the version with "print -s" standard, but
that trick will be mentioned in the info docs.
Cheers,
Edrx