Emacs as a tiling window manager

26 Jan 2010

I’ve been using emacs in in full-screen mode lately. It provides a nice, distraction-free environment. If you’re using carbon emacs it’s quite easy:

(defun mac-toggle-max-window ()
(interactive)
(set-frame-parameter nil 'fullscreen
(if (frame-parameter nil 'fullscreen)
nil
'fullboth)))
(global-set-key (kbd "<C-M-return>") 'mac-toggle-max-window)


I also really enjoy the efficacy of navigation provided by tiling window managers such as xmonad. So, why not make emacs behave like it?

emacsd-tile.el is a really tiny configuration snippet to provide just this.

It provides xmonad-inspired keyboard shortcuts:

 M-{j,k,h,l} → move to window (down, up, left, right) M-S-{j,k,h,l} → enlarge/shrink horizontally/vertically M-C-{j,k,h,l} → swap with (down, up, left, right)

This mostly uses just stuff that was already in emacs! The only part I had to implement myself was window swapping.

Another really handy feature of emacs is the ability to save window configuration in registers. With this, you can “stash” away an entire window configuration and recall it later.

Here’s a screenshot, though it’s not really descriptive because it doesn’t show the keybindings in action, but it may convince you that emacs can at least look like a tiling window manager :-)

Any other improvements or suggestions?