Vi Macro Guide - patch 1

Maarten Litmaath maart at cs.vu.nl
Thu Aug 24 06:14:30 AEST 1989


: This is a shar archive.  Extract with sh, not csh.
: This archive ends with exit, so do not worry about trailing junk.
: --------------------------- cut here --------------------------
PATH=/bin:/usr/bin:/usr/ucb
echo Extracting 'macro-guide.diff'
sed 's/^X//' > 'macro-guide.diff' << '+ END-OF-FILE ''macro-guide.diff'
X*** macro-guide	Tue Aug  1 23:06:00 1989
X--- macro-guide.new	Wed Aug 23 20:31:24 1989
X***************
X*** 1,7 ****
X  Vi Macros, Abbreviations, and Buffers
X  Copyright (C) 1988 by Fred Buck; all rights reserved.
X- Additions: 1989 Maarten Litmaath <maart at cs.vu.nl>
X  Thanks to: Jean-Pierre Radley <jpradley!root at uunet.uu.net>
X  
X  Heading summary:
X  =================
X--- 1,10 ----
X  Vi Macros, Abbreviations, and Buffers
X  Copyright (C) 1988 by Fred Buck; all rights reserved.
X  Thanks to: Jean-Pierre Radley <jpradley!root at uunet.uu.net>
X+ Contributions:
X+ 	1989 Maarten Litmaath <maart at cs.vu.nl>
X+ 	1989 Eamonn McManus <emcmanus at cs.tcd.ie>
X+ Patchlevel: 1
X  
X  Heading summary:
X  =================
X***************
X*** 121,129 ****
X  which yanks into named text buffer "a" the text between your current cursor
X  position and the exact location of text marker "b", which we assume you've
X  previously set.  The "yank" will end JUST BEFORE the exact location of text
X! marker "b".  To yank simply an entire line, use "yy" (or "Y") instead of "y"
X! and the cursor-movement command; to yank N number of lines from your current
X! cursor position, use 
X  
X  		"aNyy
X  
X--- 124,133 ----
X  which yanks into named text buffer "a" the text between your current cursor
X  position and the exact location of text marker "b", which we assume you've
X  previously set.  The "yank" will end JUST BEFORE the exact location of text
X! marker "b", if that is after the cursor; if it is before the cursor the
X! "yank" happens as if cursor and marker were interchanged.  To yank simply an
X! entire line, use "yy" (or "Y") instead of "y" and the cursor-movement
X! command; to yank N number of lines from your current cursor position, use
X  
X  		"aNyy
X  
X***************
X*** 145,167 ****
X  cursor position; if you use an uppercase "P", then the text is re-inserted
X  before your current cursor position.
X  
X! 	In addition to the 26 named text buffers, 'vi' stacks deleted text
X! in a set of 10 volatile buffers, generally called the "unnamed" buffers.  By
X! "volatile" I mean that the contents of these buffers change without the
X! user's explicit direction.  Actually, only the first of these volatile,
X! delete buffers is really "unnamed"; it's the buffer that the most-recently-
X! deleted text resides in, and from which the bare "p" and "P" commands work.
X! The other nine delete buffers are reachable with the names "1" through "9".
X! So if you delete some text in 'vi', the text you've just deleted is in the
X! "unnamed" delete buffer and can be recovered with "p" or "P".  If, without
X! recovering that text, you now delete some more text, then the text you
X! previously deleted is moved to delete buffer "1" and the most-recently-deleted
X! text is now in the "unnamed" delete buffer.  Keep deleting text, and the text
X! you deleted the first time will advance from buffer "1" to buffer "2" and so
X! on, until it gets to buffer "9", and if you delete more text after that,
X! whatever is in buffer "9" is thrown away, and can no longer be recovered.
X! Actually it can be recovered if you haven't written the file since you deleted
X! the text:
X  		:w temp
X  		:e!
X  
X--- 149,171 ----
X  cursor position; if you use an uppercase "P", then the text is re-inserted
X  before your current cursor position.
X  
X! 	In addition to the 26 named text buffers, 'vi' stacks deleted LINES
X! in a set of 9 volatile buffers.  By "volatile" I mean that the contents of
X! these buffers change without the user's explicit direction.  Another volatile
X! buffer is called the "unnamed" buffer, in which the most-recently-deleted text
X! resides, and from which the bare "p" and "P" commands work.  This is the only
X! buffer in which every piece of deleted text is put, the other nine buffers
X! deal with complete lines only.  They are reachable with the names "1" through
X! "9", and hence are known as the numbered buffers.  So if you delete some text
X! in 'vi', the text you've just deleted is in the "unnamed" delete buffer and
X! can be recovered with "p" or "P".  If that text contains at least one line,
X! it is placed into buffer "1" as well, whose previous contents are shifted into
X! buffer "2" and so forth.  Keep deleting text, and the text you deleted the
X! first time will advance from buffer "1" to buffer "9".  If you delete still
X! more text, whatever is in buffer "9" is thrown away, and can no longer be
X! recovered via the buffer mechanism.  However, it can be recovered if you
X! haven't written the file since you deleted the text:
X! 
X  		:w temp
X  		:e!
X  
X***************
X*** 170,176 ****
X  reload the original file WITHOUT saving the modifications you've made.
X  They are, however, still available in 'temp'.
X  
X! 	The syntax for working with the delete buffers is the same as that
X  for the named buffers: to extract text from, say, delete buffer "1", you'd
X  say
X  
X--- 174,180 ----
X  reload the original file WITHOUT saving the modifications you've made.
X  They are, however, still available in 'temp'.
X  
X! 	The syntax for working with the numbered buffers is the same as that
X  for the named buffers: to extract text from, say, delete buffer "1", you'd
X  say
X  
+ END-OF-FILE macro-guide.diff
chmod 'u=rw,g=r,o=r' 'macro-guide.diff'
set `wc -c 'macro-guide.diff'`
count=$1
case $count in
5144)	:;;
*)	echo 'Bad character count in ''macro-guide.diff' >&2
		echo 'Count should be 5144' >&2
esac
exit 0
-- 
"rot H - dD/dt = J, div D = rho, div B = 0, |Maarten Litmaath @ VU Amsterdam:
  rot E + dB/dt = 0" and there was light.   |maart at cs.vu.nl, mcvax!botter!maart



More information about the Comp.unix.questions mailing list