[comp.editors] Help with vi's "map"

irick@ecn.purdue.edu (GarBear Irick) (09/02/90)

Just for fun, I decided to map my function keys to compile a C program on-
the-fly.  The macro writes the current text out to a temp file, compiles it,
and goes back to the editor, as belo:

map @ :w! /tmp/irick/cprog.%:!cc -o /tmp/irick/EXEC /tmp/irick/cprog.%

The only _problem_ is, vi now thiks that /tmp/irick/... is the new filename
of the file, so when I ZZ or :wq to get out of vi, it changes the temporary
file, not the original one.  Is there a way to change the current filename
in vi WITHOUT writing over that filename?  Thanks.....

-- 
Gary A. Irick,  Purdue University |
INTERNET: irick@en.ecn.purdue.edu |
UUCP:     ...!pur-ee!irick        |

rusty@steelmill.cs.umd.edu (Rusty Haddock) (09/05/90)

In article <1990Sep2.062510.27277@ecn.purdue.edu> irick@ecn.purdue.edu (GarBear Irick) writes:
   >
   >The only _problem_ is, vi now thiks that /tmp/irick/... is the new filename
   >of the file, so when I ZZ or :wq to get out of vi, it changes the temporary
   >file, not the original one.  Is there a way to change the current filename
   >in vi WITHOUT writing over that filename?  Thanks.....

Try
	:file your-filename-here

		-Rusty-
--
Rusty Haddock				DOMAIN:	rusty@mimsy.cs.umd.edu
Computer Science Department		PATH:	{uunet,rutgers}!mimsy!rusty
University of Maryland			"IBM sucks silicon!"
College Park, Maryland 20742			-- PC Banana Jr,"Bloom County"