sandvich.xyz/content/posts/you-dont-need-tabs-on-neovi...

2.9 KiB
Raw Permalink Blame History

title date tags
Do you really need tabs/bufferlines in Neovim? 2023-07-28
software
technology

When I was previously using Emacs, one feature I found that was not really implemented was tabs for each buffer. I was extremely used to bufferlines (which is what people usually mean when they refer to "tab") as I was using Neovim before I switched to Emacs and back to Neovim. As I got used to it, I found out that I was better off with a buffer list than a bufferline.

(Newer) Neovim users tend to prefer bufferlines, while Emacs users tend to prefer buffer lists. This would not be true five years ago, but it is now. I guess the reason for this is that there are more people from tabbed editors such as VSCode, Atom, and Sublime migrating to Neovim than to Emacs.

As a result, tabs and bufferlines are more popular than buffer lists. Buffer lists are often overlooked, not known to many people, and sometimes perceived as archaic.

However, your workflow might be more appropriately suited towards buffer lists, and you just do not know it.

The main reason for using Neovim for many people is that its heavily keyboard-centric. It is far easier to navigate Neovim with the keyboard than the mouse. However, when using a bufferline, if you are not using a mouse, it takes multiple TABs and C-TABs to find the file you want. In a buffer list, its the same if not better. You can filter through files by typing its name and finding it in the buffer list rather than scanning the names of each file in the bufferline.

A bufferline also takes up the top part of your screen. It is not as big of a deal, but as you open more files, it becomes more difficult to navigate. Your bufferline is usually always visible showing every tab when you dont need it. A buffer list is only open when invoked, through a command or shortcut. It does takes up more space, but only when needed.

The way people using bufferlines avoid both of these issues is to close buffer tabs once they are finished with working on the file. However, this means you have to keep track of what other files you have open and how many tabs are open. In a buffer list, you only open a file once, and once you are finished with it, you switch to another buffer.

An additional pro for buffer lists that may not apply to everyone is its ability to preview files. In Neovim, I use Telescope to pick buffers, and it includes a file previewer. This makes it easier for me to look across files without actually switching to them and having to switch back. A recent use case I had was to quickly check what other tags my other posts had.

As you can see, buffer lists are an extremely overlooked feature in favor of bufferlines/tablines. While users coming from editors that primarily use tabs may be more familiar with the bufferline, buffer lists would especially help for those whose workflows involve dealing with multiple files at once.