vi question

vi question

Post by Markachev, Naiden [SKY:4Y21:EXCH » Wed, 13 Sep 2000 22:27:26



hello everyone,

how does one quits a buffer with vi ? What I am doing is editing a
couple of buffers and when I don't need a buffer any more I want it
written to a file and out from my vi session. And what I do is goto this
buffer and type :q which quits my whole vi session. What's wrong here?

Thanks,
Naiden

PS. I am using vi, not vim, gvim etc.
--
"Witty quotes mean nothing" -- Voltaire

 
 
 

vi question

Post by John Gord » Wed, 13 Sep 2000 22:53:41



Quote:> how does one quits a buffer with vi ? What I am doing is editing a
> couple of buffers and when I don't need a buffer any more I want it
> written to a file and out from my vi session. And what I do is goto this
> buffer and type :q which quits my whole vi session. What's wrong here?

if i'm reading your question right, you actually have two questions:
"how do i save the current file?" and "if i vi'ed more than one file,
how do i move to the next file?

the current file can be saved in at least two ways:  the ZZ command,
or the :w command.

you can move to the next file with the :n command.

---
"... What with you being his parents and all, I think that you could
be trusted not to shaft him."  -- Robert Chang, rec.games.board



 
 
 

vi question

Post by Derek M. Fly » Wed, 13 Sep 2000 23:26:14



> how does one quits a buffer with vi ? What I am doing is editing a
> couple of buffers and when I don't need a buffer any more I want it
> written to a file and out from my vi session. And what I do is goto this
> buffer and type :q which quits my whole vi session. What's wrong here?

Use :w to write it, :e file to edit file "file".  See the manual page for
more info.
 
 
 

vi question

Post by Markachev, Naiden [SKY:4Y21:EXCH » Wed, 13 Sep 2000 23:23:26


Hi John,

Thanks for answering my question but what I am asking is how to close a
buffer without quitting a vi session. Lets say you edit the files a, b
and c and you don't need the c buffer in memory any more [easier to move
with :n #]. How do you get rid of it form the vi session without
quitting it [the session].

Thanks,
Naiden

> if i'm reading your question right, you actually have two questions:
> "how do i save the current file?" and "if i vi'ed more than one file,
> how do i move to the next file?

> the current file can be saved in at least two ways:  the ZZ command,
> or the :w command.

> you can move to the next file with the :n command.

> ---
> "... What with you being his parents and all, I think that you could
> be trusted not to shaft him."  -- Robert Chang, rec.games.board



--
"Witty quotes mean nothing" -- Voltaire
 
 
 

vi question

Post by Brieuc Jeunhom » Wed, 13 Sep 2000 23:41:08


Quote:> Thanks for answering my question but what I am asking is how to close a
> buffer without quitting a vi session. Lets say you edit the files a, b
> and c and you don't need the c buffer in memory any more [easier to move
> with :n #]. How do you get rid of it form the vi session without
> quitting it [the session].

:bd buffer_number

Fu2 comp.editors

--
BBP

 
 
 

vi question

Post by Markachev, Naiden [SKY:4Y21:EXCH » Wed, 13 Sep 2000 23:45:23


Thanks Derek but that's not what I was asking. Here is my question
rephrased.
What is the vi equivalent of the C-x k [read kill buffer] emacs command.

Naiden
PS. vi(1) appears to not have this info.

Quote:> Use :w to write it, :e file to edit file "file".  See the manual page for
> more info.

--
"Witty quotes mean nothing" -- Voltaire
 
 
 

vi question

Post by Derek M. Fly » Thu, 14 Sep 2000 00:10:04



> Thanks Derek but that's not what I was asking. Here is my question
> rephrased.
> What is the vi equivalent of the C-x k [read kill buffer] emacs command.

> Naiden
> PS. vi(1) appears to not have this info.

You're imposing an emacs editing perspective on vi.  In vanilla vi, you
cannot maintain two files with changes.  You need to write or discard the
changes to the first to move on to the next.  So the concept of a buffer
is not analogous between emacs and vi.  The vi model is much more like
editing a file afresh everytime.

A single editor session can be used to make changed to several files, and
to copy text from one file to another, etc (the buffers are maintained
across all edits w/in a session).

The file list is set either at startup or with :n arglist.  :n by itself
moves to the next file (:n! to discard changes).  :e can edit a file by
name (:e! discards changes), using the special characters % and # to
represent the current and alternate file.

But thats pretty much it.

 
 
 

vi question

Post by Thomas Dicke » Thu, 14 Sep 2000 04:19:19



Quote:> Hi John,
> Thanks for answering my question but what I am asking is how to close a
> buffer without quitting a vi session. Lets say you edit the files a, b
> and c and you don't need the c buffer in memory any more [easier to move
> with :n #]. How do you get rid of it form the vi session without
> quitting it [the session].

:e foo

(where foo doesn't already exist)

--

http://dickey.his.com
ftp://dickey.his.com

 
 
 

1. vi question - unknown terminal type

Recently, I added some new termcap entries to the end of our /etc/termcap
file.  Everything seems to work O.K. with these terminals, EXCEPT vi.  
When vi is started, we get an 'Unknown terminal type' message.  The terminal
name IS in /etc/termcap.  Where else does vi look?  What might be the problem?

--

Microelectronics Reliability Division          |            COMPMAIL:  e.ratazzi
Rome Laboratory                                |                  (315) 330-2946
"Exploring the Invisible Frontier"             |                    DSN 587-2946

2. Non-interlace frame grabber

3. One vi question

4. Wanted: Experience with Solstice AutoClient

5. a vi question!!

6. What Cards

7. VI Question - so answer it!

8. proposal:LDA--linux digital assistant

9. vi question

10. vi question (I already read the FAQ)

11. vi questions

12. vi question - mapping a function key in .exrc file that uses a yanked word