On Thu, Apr 27, 2006 at 08:41:48PM -0700, Dado Feigenblatt wrote:
> 
> Meino Christian Cramer wrote:
> >Unfortunately 
> >
> >  bd!
> >
> >has a sideeffekt:
> >
> >After 
> >
> > :e file1
> >
> >and
> >
> > :e file2
> >
> >I edit file2 and (accidently) file1.
> >
> >With <C-^> I go back to file1 and
> >
> > bd!
> >
> >. The window (or is it a buffer?) disappear.
> >
> >Now I did some
> >
> > <C-^>
> >
> >and: TADA! Here it is again and perfectly loaded: file1
> >
> >Ooops...I told vim to forget that file...
> >
> >Any way arround this ?
> >
> >Keep hacking!
> >mcc
> > 
> >
> I work the same way as you do, but I don't use C-^
> I use :bn[ext ] or :bp[revious], mapped to C-n and C-p, respectively.
> Then :bd! works flawlessly.
> I'm not sure what the difference is though.

What C-^ does is switch between the current file and the alternate
file (:help alternate-file).  :bd! doesn't completely remove the buffer
from Vim, as you can see with :ls!, C-^, :b1, etc.  :bd is like putting
the buffer away in a closet.  You can still come back and get it if you
need to and all the information associated with it (like marks, its
buffer number, the buffer-local options, etc) will be remembered.  In
order to go that extra step and really make Vim forget about the buffer,
you need to use :bw (:bw! to abandon changes).

James
-- 
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[EMAIL PROTECTED]>

Attachment: signature.asc
Description: Digital signature

Reply via email to