 <p>This boils down to the way Vim behaves; when you close a window, Vim does not move to the last active window. Unfortunately, there's no way around this, as it isn't really viable to remember the "last active window" from Vim's perspective; window ids are not constant in vim, so there's no reliable way to script the exact behaviour you want.</p>