Skip to content

Emacs: Display tab names of the tab bar in the echo area

License

Notifications You must be signed in to change notification settings

fritzgrabo/tab-bar-echo-area

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tab-bar-echo-area.el

Provides a global minor mode to temporarily display a list of available tabs and tab groups (with the current tab and group highlighted) in the echo area after tab-related commands.

This is intended to be used as an unobtrusive replacement for the Emacs built-in display of the tab-bar (that is, when you have tab-bar-show set to nil).

The idea is to provide but a quick visual orientation aid to the user after tab-related commands, and then get out of the way again.

I recommend using this together with the tab-bar-lost-commands package, which provides simple and convenient commands that help with common tab bar use-cases regarding the creation, selection and movement of tabs. You might also want to check out the tab-bar-groups package, which backports a simplified version of Emacs 28 tab groups to Emacs 27 and provides an integration with this package.

Installation

If you use MELPA, an easy way to install this package is via package-install. Alternatively, download tab-bar-echo-area.el, put it in your load-path and require it. Finally, use (tab-bar-echo-area-mode 1) or M-x tab-bar-echo-area-mode to turn on the provided minor mode.

If you use both MELPA and use-package, you can use this, too:

(use-package tab-bar-echo-area
  :ensure
  :config
  (tab-bar-echo-area-mode 1))

Screenshots

Showing 3 tab names foobar, barbaz, bazqux, with bazqux being highlighted as the current tab.

screenshots/tab-bar-echo-area.png

Showing a closed tab group foo, the current tab group bar with tabs barbaz and barbam, and an ungrouped tab bazqux, with barbam being highlighted as the current tab (requires Emacs 28 or the tab-bar-groups package for tab groups).

screenshots/tab-bar-echo-area-groups.png

The faces applied to the current/other tabs and groups are fully customizable.

Commands

Table of available commands and their description.

CommandDescription
tab-bar-echo-area-display-tab-nameDisplay the current tab’s name in the echo area
tab-bar-echo-area-display-tab-namesDisplay all tab names in the echo area (highlight current tab’s name)

Recommended Keybindings

Note that this package doesn’t bind any keys by itself.

In my local configuration, I added bindings for the above commands to the pre-existing keymap for tab-related commands (C-x t):

(use-package tab-bar-echo-area
  :ensure
  :demand
  :config
  (tab-bar-echo-area-mode 1)
  :bind (:map tab-prefix-map
              ("c" . tab-bar-echo-area-display-tab-name)
              ("P" . tab-bar-echo-area-display-tab-names)))

About

Emacs: Display tab names of the tab bar in the echo area

Resources

License

Stars

Watchers

Forks