Emacs got tabs

Nowdays a lot of applications, starting from web browser to modern text editor, use the tab UI concept: you can have multiple contents within a single window, and the window is divided into separated spaces by means of tabs.
Even IDEs have tabs since a while.

In Emacs I never had the need for tabs: Emacs has buffers, and that is very powerful stereotype that can behave in a very similar way of how tabs do. Moreover, I like having the full content (i.e., the full buffer) on my window, so I’m not tab-dependent.

However, recently released Emacs 27 introduced the native tab support{:target=”_blank”, both for GUI and terminal application.
Every tab in Emacs is an **indipendent window configuration
(in Emacs terminology), so you can split tabs into buffers, essentially as they are different frames. Of course, you can have multiple frames, each divided into multiple tabs, each tab divided into multiple buffers.

Tab commands

The main commands for interacting with tabs are:
  • C-x t 2 creates a new tab;
  • C-x t 0 closes the current tab;
  • C-x t 1 closes the other tabs;
  • C-x t o changes to the next buffer;
  • C-x t f finds a file in another tab (open file into another tab);
  • C-x t d opens a directory (dired) in another tab.

As you can see, many commands are quite common with the buffer actions, or frame actions, and have the prefix C-x t.

Here are some screenshots of the tabbing in action, please note that the tab bar is placed at the top of the frame.




I’m not sure I’m going to use this tab functionality for several reasons:
  1. the keyboard shortcuts are quite long and not easy to remember, at least at first;
  2. I’m used to switching between buffers;
  3. the buffer list does not provide any information about the tabs a buffer belongs to. Moreover, switching a buffer happens within the current buffer, that could not be what I want to do (if I think at tab as a perspective like environment).


However, this is a clear answer to all those people that say they are not going to leave their favourite environment because of the lack of tabs!

The article Emacs got tabs has been posted by Luca Ferrari on July 22, 2021