This question is related, but I would like to achieve the opposite. My vim screen is vertically split in 2. I have opened several files in the right window. When I close the file with :q
or :bdelete
the right window closes. Is it possible to have a behaviour where the right window stays open and shows the last open file in that window?
Asked
Active
Viewed 62 times
0

Paul Rougieux
- 10,289
- 4
- 68
- 110
-
Thanks @dlmeetei `:b#|bd#` works. – Paul Rougieux Aug 09 '17 at 10:38
-
You don't "open several files in the right window". – romainl Aug 09 '17 at 16:09
-
@romainl are you referring to the [Vimdoc](http://vimdoc.sourceforge.net/htmldoc/windows.html#window) description _"a window is a viewport on a buffer"_? Intuitively I thought these were files open. I find it confusing that the screen resizes itself when I close a file. I would like to maintain the vertical split and start editing a new file in the right screen. – Paul Rougieux Aug 10 '17 at 08:04
-
I mean that files are not and can't be associated with windows. – romainl Aug 10 '17 at 10:14
-
@romainl , could you please explain why files "can't be associated with windows."? – Paul Rougieux Aug 10 '17 at 12:23
-
1When you open a "file", a "buffer" is created and added to the "buffer list". Because that list is global it's impossible to associate a buffer and a "window" and therefore a file and a window. The right way to think about windows is as "viewport": you create a new viewport through which you can look at any given buffer. – romainl Aug 10 '17 at 16:13