Friday, January 8, 2010

Re: If I quit a buffer how do I keep the one I was last editing displayed (when using NERDTree)??

Hi Tony!

On Fr, 08 Jan 2010, Tony Mechelynck wrote:

> the way % represents the current file. So basically, with :e # (or
> Ctrl-^) # becomes % and vice-versa. So, to go back to the previous
> editfile and then remove the file you shortly viewed from the buffer
> list, use
>
> :e #
> :bdel #
>
> Note that here the two # signs represents different files, because of
> the way :e # swaps # and %

Note that if you are issuing :e # again, you can reopen that buffer. If
you use :bw # the alternate file name will be undefined and :e # will
result in an error.

> If you have 'hidden' set, the :e[dit] will succeed, but I'm not sure
> what will happen with the :bd[elete] -- I /think/ that it will keep the
> buffer in memory, but "unlisted", i.e. shown by :ls! (with bang) but not
> by :ls (without bang), and in any case still unsaved, which IMHO is
> something dangerous to have -- you could just too easily forget about
> this "modified unlisted buffer" in this case.

no, :bd will complain and not succeed, while :bd! will silently abort
your changes. I don't see a problem with that.


regards,
Christian
--
hundred-and-one symptoms of being an internet addict:
57. You begin to wonder how on earth your service provider is allowed to call
200 hours per month "unlimited."

No comments: