You can try my short script which does exactly what you want: http://www.vim.org/tips/tip.php?tip_id=1078
--Matt On Fri, May 12, 2006 at 08:38:24PM +0300, Yakov Lerner wrote: > On 5/12/06, Salman Khilji <[EMAIL PROTECTED]> wrote: > >When you have a window split, issuing a :bd command > >closes the buffer AND one panes of the split window as > >well. > > > >I like to have my maximized window split vertically in > >2 panes all the time and would NOT want the :bd > >command to close any of the panes. > > > >Can it be done? > > You can't make :bd a total no-op. But. You can try the > following trick to make the deteled buffer *re-appear*. > Buffer will flick but won't go away if you work out all > details of this. Here is the idea: > 1. hook the BufDelete autoevent. > 2. for your "undeletable" buffer(s), set some b: > variable, say b:undeletable to true. (you probably > won't want to make all buffers undeletable, only some). > 3. In BufDelete event, check b:undeletable > flag. If the flag is on, then > 4. create new buffer with same size, position, > contents, setting, and proper cursor position. > > I didn't try it, but i think it can be made to work. > You'll need to resolve many small details along > the way, like how to restore position, contents, > cursor, and settings of the deleted/restore buffer. > Note than undo history of the restores buffer > will be inevitably lost. > > Yakov