tvjg / iswitchw

Fast keyboard-driven window switching via AutoHotKey

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

iswitchw

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).

Usage

iswitchw strives to be as intuitive as possible.

  • Win + Space activates iswitchw
  • Esc cancels at any time
  • Tab to advance the selected window match
  • Up/Down arrow keys move through the matches
  • Left/Right arrow keys move the insert cursor in the search box
  • Home/End move the insert cursor or match selection depending on context
  • Ctrl + Delete/Backspace removes a word from the search
  • Ctrl + Left/Right arrow 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 then press 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.

Options

User configurable options are presented at the top of the ahk script.

Example

iswitchw in action

Todo

  • 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

History

Original inspiration provided by the creators of the iswitchb package for the Emacs editor.

2004/10/10, CREATED by keyboardfreak [link]
2008/07/03, MODIFIED by ezuk [link]
2011/06/11, MODIFIED by jixiuf [link]
2013/08/23, MODIFIED by dirtyrottenscoundrel [link]

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.

About

Fast keyboard-driven window switching via AutoHotKey

License:MIT License


Languages

Language:AutoHotkey 100.0%