Windows Without Rodents

by Nicolas Wu

Posted on 16 September 2010

Tags: Windows

My preferred set up for developing code is a unix environment, and I run Ubuntu on my home machine, with XMonad as my main interface. I’ve found the combination to be rock solid, and with XMonad I get an efficient way of navigating between the various applications I have open: I rarely have to lift my hands off the keyboard.

Unfortunately, my new workplace requires me to use Windows 7 for all development, and the situation isn’t likely to change. It’s actually been a few years since I have used Windows, and coming back to its clunky plastic interface was quite a shock to me, so I quickly did all I could to make Windows feel a bit more like /home. In the end, I settled on three tools: AutoHotkey, WindowsPager, and WinSplit.


One of the most important features I seek in a window manager is simple navigation so that I can get around the screen easily without reaching for the mouse. Windows comes with plenty of built in keystrokes that let you navigate between windows. While almost everybody knows about Alt-Tab, I tend to prefer the slightly less famous Alt-Esc, which performs the same function, except doesn’t have a pop up dialog. Being able to rebind keys makes the hard to reach, but really important, functionalities of Windows useful. AutoHotkey, is perfect for this, and here are the settings held in the XMonad.ahk I’ve got on my machine:

#j::Send !+{Escape}
#k::Send !^{Escape}
#d::Send !{F4}

This lets me navigate between currently opened windows by pressing Super-j and Super-k, and to close a currently open window with Super-d. These bindings are modelled after the inteface for Vim, which is my main text editor.

Since I often use the left super key, which activates the Windows program launcher, I disable it using this:

> ~LWin Up::Return


Having a single desktop to handle everything is a cluttered and cramped experience. WindowsPager, makes things a bit better by giving you 4 desktops to play with, and works fine right out of the box. This lets you set up different desktop environments based on the tasks you’re doing.

I always have the following setup:

Desktop1 : Development   (vim, visual studio)
Desktop2 : Research      (firefox)
Desktop3 : Execution     (program debugging)
Desktop4 : Communication (email,irc,music)

Using AutoHotKeys, I bind shortcuts to move around by adding the following to my script:

#1::Send #^{Numpad1}
#2::Send #^{Numpad2}
#3::Send #^{Numpad3}
#4::Send #^{Numpad4}
#+1::Send #!^{Numpad1}
#+2::Send #!^{Numpad2}
#+3::Send #!^{Numpad3}
#+4::Send #!^{Numpad4}

You can move from desktop to desktop by pressing Meta-Ctrl-Numpad1 through to Meta-Ctrl-Numpad4, and you can move a window to another desktop by selecting it and adding Shift to the sequence.


Having different desktops for different tasks means that there’s plenty of space left for your windows, so that they can be arranged in a clean and consistent way.

WinSplit does this job very well, by allowing windows to be resized from the keyboard into various configurations.

With a couple modifications, everything I need is at the touch of a few simple keystrokes. First, I modify all the WinSplit bindings so that just pressing Super-Numpad1 moves a window to the bottom left corner of the screen, and likewise for all the other numpad keys.

Once this is done, I also bind Super-h and Super-l to allow simple window repositioning. However, since Windows uses Super-l to lock the screen, this feature must first be disabled in the registry. This can be set using AutoHotkey, and adding the following line:

> RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Policies\System, DisableLockWorkstation, 1


With all these tweaks in place, I noticed my productivity increased significantly, and I spent a lot less time pausing between applications and reaching for the mouse. Two other indispensable tools are Vim, and Vimperator, which make the mouse redundant for almost every task.