"Toggling file names in vi"

William L. Sebok wls at astrovax.UUCP
Thu Mar 22 07:57:07 AEST 1984


A great example of the use of toggling file names in vi is the use of the
two files accessed by vi after a  a (r)eply or (f)ollowup command from vnews.
The first file is the temporary file which will become your reply/followup.
To read this article file into your reply/followup temporary file give these
commands.

:n			To go to the article file

:e #			To go back to the temporary file

:$r #			Read the article file into the original file.

Now one has a temporary file which contains a copy of the original article.
One can then edit it down to shape.

I felt a great sense of accomplishment when I first figured this out. 
Unfortunately vi has no direct command (I am aware of) to read the "next" file.
Thus the trick of going to the article file and back to the temporary file to
make the article file the "previous" file.
-- 
Bill Sebok			Princeton University, Astrophysics
{allegra,akgua,burl,cbosgd,decvax,ihnp4,kpno,princeton,vax135}!astrovax!wls



More information about the Comp.unix mailing list