Moving Among Emacs Windows

Once you discover the utility of having multiple windows in a single Emacs frame, the question of how to switch between those windows arises naturally. Emacs, of course, has you covered. You can use Ctrl+x o to cycle between windows. That’s great if you have only a couple of windows in a frame but it becomes tedious when there are multiple windows. That, of course, happens often once you get used to making maximum use of Emacs.

Marie K. Ekeberg over at TheMKat has a solution. It’s a nice solution in the sense that it’s built into Emacs so you can use it without adding anything extra. That solution is windmove. Ekeberg didn’t like the default bindings but, as she says, it’s easy to change them to whatever is comfortable for you.

I used windmove for a while but I have since moved to ace-window, a wonderful app from abo-abo that, when invoked, labels each visible window with a number that you can use to select that window you want to move to. I’ve bound it to Ctrl+x o so I didn’t have to learn a new binding. The nice thing is that if there are only two windows—my usual situation—ace-window will simply switch to the other without further ado.

When I brought up the ace-window repository while writing this post, I noticed that there are a bunch of possible actions available. I never use any of them except switching but you may find some of them useful.

The TL;DR is that if you routinely have more than two windows in a frame, ace-window is a must have app. I’ve been using it for years and wouldn’t want to live without it.

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