9

Is it possible to have only one mode line (sometimes referred as "statusbar") for all windows?

I'd like to make this single mode line show information about the currently selected buffer.

  • 2
    Perhaps you could borrow the concept in the attached thread and create a dedicated window on the bottom of every frame, which shows only a custom mode-line? emacs.stackexchange.com/questions/7697/… – lawlist Feb 24 '15 at 22:18
  • Surely you mean windows, not frames? – abo-abo Feb 25 '15 at 11:42
  • Good catch. Yes, I mean windows. – rgtk Feb 25 '15 at 13:18
8

I don't have a solution for a single modeline, but here are two possible alternative solutions:

1. Only render the mode line in the active window:

If you use powerline, you could wrap your mode-line-format in:

((:eval (when (powerline-selected-window-active) ...)))

then change the mode-line-inactive face so blends with your background but still separates buffers with:

(set-face-attribute 'mode-line-inactive nil
                    :underline t
                    :background (face-background 'default))

This will look like this:

enter image description here

2. Use the frame-title-format

Your frame-title-format determines what is show on the top of your frame when running in a gui.

Set the frame-title-format' like you would yourmode-line-format` and them set your mode-line-format to something blank-ish.

4

I've finally achieved this by hacking emacs. Demo

You can get the source code from https://github.com/amosbird/emacs/tree/onemodeline . Basically it uses mini-window's header line to render current buffer's modeline.

  • Does this still work/work with emacs 26.1? – rien333 Jul 8 '18 at 17:05
  • @rien333 It should. But this method is indeed very fragile. There are still hardcoded logic that requires mini window being one line. However I couldn't find them all. – Amos Jul 9 '18 at 7:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.