Lured in by the promise of evil-mode, I've been moonlighting in Emacs. It's a wild world with a mix of hairy lose-ends and astoundingly smart features. One feature I really like is a command called bury-buffer
, which puts the current buffer way down at the bottom of the buffer-list and displays the previously active buffer in its place. By burying a buffer, it becomes the least likely candidate for other-buffer
(like Vim's alternate-file
on Ctrl-^
).
So, I might be bouncing back and forth between buffer A and buffer B. Then, while I'm in B, I want check something in buffer C. I do, then I bury C, and I'm put back in B with A as my alternate-file. The same is true if I had deleted buffer C rather than burying it. Either action would put me back in my A/B workflow.
If I do the same in Vim, alternating between A and B, then from B open C, the buffer list shows C as active (%
) and B as alternate (#
). When I delete C, Vim returns me to B. But C is still the alternate-file, even though it no longer appears in the buffer list. If I hit Ctrl-^
, it reopens C rather than taking me back to A.
Is there a way I can configure Vim so its alternate-file behavior would instead mark the most-recently used open buffer as the alternate instead of reviving deleted buffers? Is there a way to manipulate its concept of the alternate-file?