Tag Archives: Elisp

Better window splitting in Emacs

Emacs’ window-splitting functionality is an ergonomic way to view multiple files at once without having to deal with shuffling around floating windows or clicking between tabs. Anyone who does much with Emacs probably knows already that they can use C-x 2 or C-x 3 to split the window vertically or horizontally.

What always bothered me about this feature was that the newly-created window defaulted to the current buffer, which in layspeak means you had the same file or content open in both your new window and the old. The was almost (but not quite) never the behavior I wanted, since usually you split the window to have multiple buffers on screen at once. Typically, I would do this right after opening a new file or buffer to compare with whatever I already had open, so that I would have the old buffer in one window and the new buffer in another.

This is where having an extensible editor rocks; because in Emacs, if you get tired enough of a behavior, you start hacking elisp and fix it…