Keyboard-driven window snapping for Windows, inspired by Rectangle, Spectacle, and Square on macOS.
A small AutoHotkey v2 script that brings the Rectangle / Spectacle muscle memory to Windows. Press Ctrl+Win+← and the active window snaps to the left half. Press it again — it cycles to a third. Again — two-thirds. That's it.
If you've moved from macOS to Windows and missed your keyboard window manager, this is for you.
| RectangleWin | PowerToys FancyZones | AltSnap | AquaSnap | |
|---|---|---|---|---|
| Keyboard-first | yes | drag-first | drag-only | mostly drag |
| Zero setup (no zones to define) | yes | no | yes | yes |
| Rectangle/Spectacle shortcuts | yes | no | no | no |
| Cycle: 1/2 -> 1/3 -> 2/3 | yes | no | no | no |
| Undo last snap | yes | no | no | no |
| Single file, easy to hack | yes | no | no | no |
FancyZones is great if you want to define custom zones with the mouse. RectangleWin is for people who just want Ctrl+Win+Left to do the right thing every time, no setup.
Paste this into PowerShell. It installs AutoHotkey v2 (via winget) if you don't have it, downloads the script to %LOCALAPPDATA%\RectangleWin, registers it for autostart, and launches it. No admin needed.
iex (irm https://raw.githubusercontent.com/junegu-glitch/RectangleWin/main/install.ps1)To uninstall later:
iex (irm https://raw.githubusercontent.com/junegu-glitch/RectangleWin/main/uninstall.ps1)If you'd rather do it yourself:
- Install AutoHotkey v2 (2.0 or later).
- Download
RectangleWin.ahk. - Double-click it. Look for the RectangleWin icon in your system tray.
- For autostart: press
Win+R, typeshell:startup, and drop a shortcut toRectangleWin.ahkin there.
All shortcuts use Ctrl+Win as the base modifier. Snapping respects the work area of the monitor the window is currently on (taskbar excluded).
| Shortcut | Action |
|---|---|
Ctrl+Win+Enter |
Fullscreen (fills work area) |
Ctrl+Win+Left |
Left edge — cycles 1/2 -> 1/3 -> 2/3 |
Ctrl+Win+Right |
Right edge — cycles 1/2 -> 1/3 -> 2/3 |
Ctrl+Win+Up |
Top edge — cycles 1/2 -> 1/3 -> 2/3 |
Ctrl+Win+Down |
Bottom edge — cycles 1/2 -> 1/3 -> 2/3 |
Ctrl+Win+C |
Smart center — picks column or row 1/3 based on monitor orientation |
Ctrl+Win+H |
Force center column 1/3 (for 3-column layouts) |
Ctrl+Win+V |
Force middle row 1/3 (for 3-row layouts) |
| Shortcut | Action |
|---|---|
Ctrl+Win+Numpad7 |
Top-left quarter |
Ctrl+Win+Numpad9 |
Top-right quarter |
Ctrl+Win+Numpad1 |
Bottom-left quarter |
Ctrl+Win+Numpad3 |
Bottom-right quarter |
| Shortcut | Action |
|---|---|
Ctrl+Win+Shift+Left |
Move window to the monitor on the left (preserves size ratio) |
Ctrl+Win+Shift+Right |
Move window to the monitor on the right |
Ctrl+Win+Shift+Up |
Move window to the monitor above |
Ctrl+Win+Shift+Down |
Move window to the monitor below |
If no monitor exists in that direction, nothing happens. The window's snap state (left half, top third, fullscreen, etc.) is preserved across monitors — including across monitors with different DPI scaling, sizes, or orientation.
| Shortcut | Action |
|---|---|
Ctrl+Win+Z |
Undo last snap (restore previous position/size) |
Ctrl+Win+T |
Toggle Always-on-Top |
Ctrl+Win+O |
Cycle window opacity: 100% → 80% → 60% → 100% |
Ctrl+Win+G |
Center window on current monitor without resizing (keep current size) |
Ctrl+Win+P |
Pull window to the monitor under the mouse cursor (snap state preserved) |
- Three-column layout (landscape monitor):
Ctrl+Win+Lefttwice (-> 1/3), thenCtrl+Win+C, thenCtrl+Win+Righttwice on another window. Three equal columns. - Three-row layout (portrait monitor): same idea with
Up,C,Down— on a portrait monitorCtrl+Win+Cautomatically picks the row 1/3. - Need to force the opposite of what auto picks? Use
Ctrl+Win+H(column) orCtrl+Win+V(row) explicitly.
It's a single AutoHotkey v2 file — open RectangleWin.ahk in any text editor and rebind whatever you want. The hotkey block is at the bottom:
^#Enter:: ActFullscreen()
^#Left:: ActLeft()^ = Ctrl, # = Win, + = Shift, ! = Alt. See the AutoHotkey hotkey reference.
- v0.3.0 — Layout presets (save/restore arrangements of windows)
- v0.3.x — Window transparency hotkeys, virtual desktop move
- Later — winget package, signed standalone
.exe, customizable config file
Suggestions welcome — open an issue.
- Rectangle (macOS) — the spiritual parent
- Spectacle (macOS, archived) — the original
- Square (macOS) — the minimalist take
- AutoHotkey v2 — the runtime that makes this ~250 lines instead of thousands
MIT (c) 2026 June Gu