Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

VIM-Can you close a file w/o exiting VIM?

0 views
Skip to first unread message

James M. Vober

unread,
Mar 19, 1998, 3:00:00 AM3/19/98
to

Hello,

Is there a way in VIM to quit editing the current file and leave
the editor OPEN? When I edit a single file, and then exit it
with :q, VIM exits. Is this a VI specific "feature"?

Thanks in advance,

Jim

--
*------------------* (o o) *-------------------------*
|Jim Vober \---ooO-(_)-Ooo---\ jmv...@ra.rockwell.com|
|Rockwell Automation \ \ Phone: (440) 646-3702 |
|Allen-Bradley Co. \ KC8DZH \ Fax#: (440) 646-3993 |
|Information Networks \-----------------\ |
*-----------------------* *--------------------*

Matthias Buelow

unread,
Mar 19, 1998, 3:00:00 AM3/19/98
to

In article <slrn6h2c...@csss353.cle.ab.com>,

James M. Vober <j...@csss353.cle.ab.com> wrote:

>Is there a way in VIM to quit editing the current file and leave
>the editor OPEN? When I edit a single file, and then exit it
>with :q, VIM exits. Is this a VI specific "feature"?

Just edit a different file.
When you start up vi/vim without filename, it generates a temporary
file anyway.

--
Matthias K. Buelow * Boycott Micro$oft, see http://www.vcnet.com/bms/ *


jomamma

unread,
Mar 19, 1998, 3:00:00 AM3/19/98
to

to do this you must give it a file name for the new file:

:e new_file

if you just go:

:e

it will be the same as doing:

:e %

cheers, Angus.


James M. Vober wrote:
>
> Hello,


>
> Is there a way in VIM to quit editing the current file and leave
> the editor OPEN? When I edit a single file, and then exit it
> with :q, VIM exits. Is this a VI specific "feature"?
>

> Thanks in advance,

Preben 'Peppe' Guldberg

unread,
Mar 19, 1998, 3:00:00 AM3/19/98
to

Thus wrote James M. Vober <j...@csss353.cle.ab.com>:
> Hello,

> Is there a way in VIM to quit editing the current file and leave
> the editor OPEN? When I edit a single file, and then exit it
> with :q, VIM exits. Is this a VI specific "feature"?

In vim you cab just delete the buffer. Might sound cryptic at first,
but there is a difference between quitting and deleting the buffer.
Try :bd instead of :q

The docs have the following to say:

:[N]bd[elete] *:bd* *:bdel* *:bdelete*
:bd[elete] [N]
Unload buffer [N] (default: current buffer) and delete it from
the buffer list. If the buffer was changed, this fails. The
file remains unaffected. Any windows for this buffer are
closed. If buffer [N] is the current buffer, the next buffer
(displayed in a window) becomes the current buffer.

Peppe
--
Preben Guldberg __/-\__ The woods are lovely, dark and deep
c92...@student.dtu.dk (o o) But I have promises to keep
----------------------oOOo (_) oOOo-- And miles to go before I sleep.
http://www.student.dtu.dk/~c928400 --Robert Frost

Richard Slobod

unread,
Mar 20, 1998, 3:00:00 AM3/20/98
to

j...@csss353.cle.ab.com (James M. Vober) wrote:

>Is there a way in VIM to quit editing the current file and leave
>the editor OPEN? When I edit a single file, and then exit it
>with :q, VIM exits.

The :bd (buffer delete) command will abondon the current buffer
without exiting the editor. There are also a number of other ways of
handling this, depending upon the exact effect you want. I suggest
you read through the online help on windows and buffers
(":help vim_win" in Vim 4.x or ":help buffers" in Vim 5.0) for more
information.

0 new messages