fast keyboard-driven window switching via AutoHotKey
When iswitchw is triggered, the titles of all visible windows are shown in a popup. Start typing to narrow possible matches -- hit enter at any point to activate the top match. Matches are narrowed using an approximate/'fuzzy' filtering method similar to tools like Ido and CtrlP.
Built and tested using AutoHotkeyL v1.1.11.01 on Windows 7 (x64).
iswitchw strives to be as intuitive as possible.
Win + Spaceactivates iswitchw
Esccancels at any time
Tabto advance the selected window match
Up/Downarrow keys move through the matches
Left/Rightarrow keys move the insert cursor in the search box
Home/Endmove the insert cursor or match selection depending on context
Ctrl + Delete/Backspaceremoves a word from the search
Ctrl + Left/Rightarrow keys skip forward/backward by the word
- Click a title to activate a window with the mouse
- Any other typing should be passed through to the search
By default, iswitchw is restricted to a single instance and hides itself from
the tray. Run the script again at any time to replace the running instance. If
you want to quit the script entirely, activate iswitchw with
Win + Space and
Alt + F4.
If you want iswitchw to run when Windows starts, make a shortcut to the
iswitchw.ahk file in the folder
%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup. See here also.
User configurable options are presented at the top of the ahk script.
- Tweak scoring algorithm to work better with long window titles
- Add better explanations/examples for configuration options
- Move hotkey binding and options into ini file
Original inspiration provided by the creators of the iswitchb package for the Emacs editor.
My thanks to the previous contributors to this script. Without your work to lean on and learn from, I would have never started. My primary goals were to remove accumulated cruft and publish a version that could be easily forked. Previous implementations depended heavily on subroutines storing shared program state in undesignated globals.
Gui and global variables (including user configurable options) were trimmed to a more reasonable minimum. Window icon display code was fixed for 64-bit versions of Windows. Approximate search matching a la ido/CtrlP was added. Code length was reduced significantly. When possible, I attempted to avoid old style AHK idioms (e.g. EnvAdd, a%index%) in favor of code that would be more readable to the majority of programmers.