Prot On Writing A Custom Mode Line

Protesilaos Stavrou (Prot) has a really interesting video on writing a custom mode line. If you’re like me, your mode line customizations are limited to adding the line and column indicators and using diminish to inhibit displaying various minor modes. You can, of course, do more but the details of making a custom mode line are surprisingly fussy.

Prot’s video shows us how to do it. He starts by showing us his custom mode line. It has some nice features. One thing I liked is that only the window with focus has the full mode line. The other windows have an abbreviated mode line showing only the buffer name and its major mode. That makes it easy to tell which window has focus so he doesn’t need to change the background as the default mode line does.

Prot has some idiosyncratic notions of what should be on the mode line—he doesn’t like the line and column indicators, for example—but that’s why, after all, you have custom mode lines. His video is not about how to reproduce his mode line; it’s about how to make your own.

As I said, the process can be a bit fussy and there are all kinds of gotchas but once you know a few rules it’s pretty easy to build your own. The nice thing is you can display your candidate mode line as you build it without having to restart Emacs.

As usual, Prot provides links to his own configuration so you can copy some or all of what he did. He also provides a copy of the intermediate code he used while developing his sample mode line so you don’t have worry about copying it down from the video. The runtime is 41 minutes 53 seconds so you’ll have to schedule some time but if you’ve ever wanted to customize your mode line, it will be well worth your time.

This entry was posted in General and tagged . Bookmark the permalink.