Vim-like buffer behavior in Atom?


#1

Vim works in a way I have come to love. That is, when I’m editing a file, if I open another file in the same instance, it opens on top of the file I’m currently editing. This is because Vim loads files into “buffers” rather than just into tabs. Each tab, and split, then is just displaying the contents of a buffer. And you can open different buffers in the current tab.

I’ve seen the word “buffer” scattered across the Atom UI (and API) but so far haven’t found a way to get this feature of Vim. Are buffers in Atom conceptually similar to what they are in Vim? Has anyone seen a package that implements this feature yet?


#2

It works differently than in vim, but I think you can get something similar.

Atom has “panes” and “tabs”. Panes are always visible, and creating a new pane means to split the current pane. For example, try cmd-k <down>. After this, the current tab will be visible twice, once in the top pane and once in the bottom pane. With cmd-k cmd-n and cmd-k cmd-p you can go to the next/previous pane.

I think if you do cmd-shift-P to open the command palette, you can then search for “pane” to see which commands are available.

Hope this helps, even after such a long time.


#3

That is definitely how atom works. I’m not sure what VIM does differently.


#4

There is a fundamental difference between Atom and Vim. Let’s say the basic unit is a buffer (like a file, but maybe it’s not saved yet).

In Atom, you have some visual representation of panes and tabs, and each tab visualizes a given buffer. Given a tab, you can’t change which buffer it is displaying – you can only open a new tab.

In Vim, however, the list of buffers is global, and the tabs and splits are just visual “windows” into the list of buffers – each area can show any buffer.


#5

In Atom there is a one-to-one correspondence between files and buffers. Is this true in Vim? If not then that is the fundamental difference.

If it is true then your complaint comes down to the fact that you have to open a new tab to see a new view of a buffer. I can’t see how this could be a problem for any workflow.

Does Vim even have tabs?