[comp.sys.att] Vi bug: saves too often

michael@stb.UUCP (Michael) (04/01/89)

Does anyone have a way to stop vi from saving a file if you use a shell
escape or if you type :n?

Normally vi will not save a file out unless you say :w. On other systems
if you say :n, you will be told "Has been modified--use :n!"; if you
say :!, you will be told "[modifications not written out]". On the
unix-pc, both of these will write it out even if you didn't want it to.

			Michael
: --- 
: Michael Gersten			 uunet.uu.net!stb!michael
:	michael@stb.uu.net <mx mailers>	crash!gryphon!denwa!stb!michael
: "Robitussin" for computers? This has gone too far. Where's "Penicillian"?
: (rob. is Coff-medicine to let COFF people run bsd-dependent GNU stuff).

lenny@icus.islp.ny.us (Lenny Tropiano) (04/02/89)

In article <10671@stb.UUCP> michael@stb.UUCP (Michael) writes:
|>Does anyone have a way to stop vi from saving a file if you use a shell
|>escape or if you type :n?
|>
|>Normally vi will not save a file out unless you say :w. On other systems
|>if you say :n, you will be told "Has been modified--use :n!"; if you
|>say :!, you will be told "[modifications not written out]". On the
|>unix-pc, both of these will write it out even if you didn't want it to.
|>

Yes, stick this in your ~/.exrc file.

set noautowrite                 -or-  set noaw

Then you'll get your desired effect.

-Lenny
-- 
Lenny Tropiano             ICUS Software Systems         [w] +1 (516) 582-5525
lenny@icus.islp.ny.us      Telex; 154232428 ICUS         [h] +1 (516) 968-8576
{talcott,decuac,boulder,hombre,pacbell,sbcs}!icus!lenny  attmail!icus!lenny
        ICUS Software Systems -- PO Box 1; Islip Terrace, NY  11752

scs@lokkur.UUCP (Steve Simmons) (04/02/89)

In article <10671@stb.UUCP> michael@stb.UUCP (Michael) writes:
>Normally vi will not save a file out unless you say :w. On other systems
>if you say :n, you will be told "Has been modified--use :n!"; if you
>say :!, you will be told "[modifications not written out]". On the
>unix-pc, both of these will write it out even if you didn't want it to.
>: Michael Gersten			 uunet.uu.net!stb!michael

???  This has not been my experience with any release of the
Unix-PC software.  I suspect you've set your vi sessions up using
'autowrite' mode.  To find out, the next time you're in vi give
the command
	:set
and see what's listed.  Dollars to donuts you get autowrite.  There's
this places it could come from: your EXINIT environment variable,
a file named .exrc in your home directory, or a file named .exrc in
your local directory.
-- 
+ Steve Simmons, Inland Sea Software, Ltd.         scs@lokkur.dexter.mi.us +
|    9353 Hidden Lake, Dexter, MI. 48130                   313-426-8981    |
+          "When Dexter's on the Internet can Hell be far behind?"         +

pat@rwing.UUCP (Pat Myrto) (04/03/89)

In article <10671@stb.UUCP>, michael@stb.UUCP (Michael) writes:
> Does anyone have a way to stop vi from saving a file if you use a shell
> escape or if you type :n?

The reason vi is behaving as you describe is because you have the
autowrite feature on.  In the .kshrc file a line sets EXINIT to
'set ai aw sm' or there is a similar line in your .exrc file.  You
simply need to remove the 'aw' from that line, or from a 'set' command
in the .exrc file if one is used.  Or you can issue from within vi the
command 'set noaw' if you simply want to turn the feature off for the
one editing session.  Hope this helps.

-- 
Pat Myrto @ Seattle, WA
UUCP:  {backbones}  ...!uunet!nwnexus!happym!rwing!pat

"Travelling unarmed is like boating without a life jacket"