v03i020: "redo"

Stephen J. Hartley hartley at uvm-gen.UUCP
Thu Jun 2 04:42:57 AEST 1988


>From article <8805171730.AA22099 at cope>, by goldman at cope.ucsf.edu (Eric S. Goldman):
< comp.sources.misc: Volume 3, Issue 20
< Submitted-By: "Eric S. Goldman" <goldman at cope.ucsf.edu>
< Archive-Name: redo
< 
< -----------------CLEAR-TEXT VERSION----DO *NOT* CUT AND USE--------------------
< # Edit history list at line containing last command (open mode).
< # Get up to 22 most recent commands.
< # To work properly, put in .login:  alias r source /usr/local/bin/redo
< # Author unknown.
< history -h 22 >! /tmp/redo.$$
< 
< # Make CR map to :wq! and start ex quietly at 2nd to last line in open mode.
< ex - '+map ^M :.wq\!^[|$-1 open' /tmp/redo.$$
< tail -1 /tmp/redo.$$ >! /tmp/cmd.$$
< 
< # Insert into history without executing.
< source -h /tmp/cmd.$$
< 
< # Clear out temporaries.
< /bin/rm -f /tmp/{cmd,redo}.$$
< 
< # If thing chosen to redo is the redo alias itself then DON'T redo it.
< if (!-2:0 != !!:0) !!
< 

This script starts up a one-line-window edit session of the last command
on the bottom of the screen.  One can then use the hjkl keys to move around
the last 22 commands.  Any movement up (k) or down (j) adds another line
to the bottom of the screen (scrolls).  Is there any way to modify the
way "ex" is fired up in the script so that only one line at all times is
displayed at the bottom of the screen, i.e. a true one-line edit window
(movement up or down in the file overwrites the old line with the new line)?
Thanks for your wizardry!
-- 
Stephen J. Hartley, Dept Comp Sci Elec Eng, Univ Vermont, Burlington, VT  05405
CSNET:	hartley at uvm.EDU					(802) 656-3330, 862-5323
USENET:	...!uunet!uvm-gen!hartley, {decvax,ihnp4,linus}!dartvax!uvm-gen!hartley



More information about the Comp.unix.wizards mailing list