Loading ...
Sorry, an error occurred while loading the content.

Re: close a buffer

Expand Messages
  • A. J. Mechelynck
    ... close the current editfile and edit filename in its stead. ... close the current editfile and edit nothing (a blank buffer) in its stead. I think you
    Message 1 of 9 , Oct 29, 2005
    • 0 Attachment
      Steven Woody wrote:
      > "A. J. Mechelynck" <antoine.mechelynck@...> writes:
      >
      >> Steven Woody wrote:
      >>> "A. J. Mechelynck" <antoine.mechelynck@...> writes:
      >>>
      >>>> Steven Woody wrote:
      >>>>> after usign :e filename to open a buffer, how do i close it? thanks.
      >>>>>
      >>>> As often in Vim, there are several possibilities
      >>>>
      >>>> see
      >>>> :help :close
      >>>> :help :q
      >>>> :help :wq
      >>>> :help :x
      >>>> :help :exit
      >>>> :help ZZ
      >>>> :help :enew
      >>>> :help :e
      >>>>
      >>> they are not i wanted. 'close' just close windows (there are only one window bu
      >>> many buffers), 'q' will exit the vim. i just need to close buffer.
      >>>
      >>>
      >>>
      >>>
      >> well, did you check the last two in the list above? They will close the
      >> current buffer but not the current window.
      >
      > :e -- edit the current file
      > :enew -- edit a new unnamed file
      >
      > they are totally other things.
      >
      >
      >
      >

      :e filename

      close the current editfile and edit "filename" in its stead.

      :enew

      close the current editfile and edit nothing (a blank buffer) in its stead.

      I think you should specify in some more detail what you mean by "closing
      the current buffer when not in split-window mode". Vim always has at
      least one open edit window. If you close the last edit window, Vim
      quits. So if you want to |abandon| (q.v.) the file currently in the only
      edit window, but not quit Vim, then you must decide what must go in the
      edit window -- either a named file (:edit filename) or an unnamed buffer
      (:enew).

      Best regards,
      Tony.
    Your message has been successfully submitted and would be delivered to recipients shortly.