Winner Mode

Ken Huang over at whatacold’s space has a very useful post on Emacs’ winner mode. I was familiar with the name “winner mode” long before I started using it but the name seemed slightly off-putting and offered no clue as to what it did so I ignored it. Later, I somehow discovered1 what it actually did and I’ve been a dedicated user ever since.

The TL;DR is that it will restore your previous window configuration(s). The typical use case is that you perform some temporary action, such as invoking HELP, and afterwards want to return your window configuration to what it was. Winner mode maintains a stack of window configurations so you can restore configurations older than the previous one.

You can also move forward to reestablish the last replaced configuration. The problem with that is that you can move forward only one configuration but I’ve never found that a problem because I almost never want to do that.

One potential problem that Huang points out is that moving back several configurations can be awkward because the default binding is Ctrl+c
, which is slightly hard to type. Huang offers a nice solution for this: a hydra that you invoke with Ctrl+c w and then simply type p to move backward for each configuration.

If you’re a winner-mode user, you may be interested in his hydra. If you want to see it in action, Huang has an embedded video demonstrating winner mode and the hydra. The video is just over 12 minutes so plan accordingly.

Footnotes:

1

Oh. It turns out it was yet more good advice from Phil.

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