jeetsukumaran / vim-buffergator

Vim plugin to list, select and switch between buffers.
498 stars 49 forks source link

Automatic split when switching from unsaved buffer #2

Closed hemmer closed 13 years ago

hemmer commented 13 years ago

If a buffer is unsaved and I switch buffers using the plugin, a horizontal split is created with the unsaved file at the bottom and the newly selected buffer at the top.

I couldn't spot anything obvious about this in the docs - if this is the desired behaviour, is there a way to allowing file switching with unsaved files without the split? (Apart from this I love the plugin, works perfectly!)

jeetsukumaran commented 13 years ago

This behavior occurs (and is unavoidable) if you do not have hidden set. Try this in your ~/.vimrc:

set hidden

This allows a window to switch out buffers even if the buffer has not been saved. Without it, a window will refuse to switch out an unsaved buffer, and you get the splitting behavior that you describe.

hemmer commented 13 years ago

Perfect, thanks for your help.