6 ms·
Window-Switcher: Alt+(backtick) same-app window switching for Windows 10/11
- leejoramo 2y agoI miss these macOS shortcuts when I am other platforms. For Windows, I wrote my own extensive AHK scripts to duplicate most Mac shortcuts I regularly use, including cursor movement On Linux I now use Toshy https://github.com/RedBearAK/toshy https://github.com/RedBearAK/toshy
- ethanpil 2y agoYou have those AHKs somewhere online? Would love to peruse them...
- davisoneee 2y agoFor the 'cycle windows of current app', i've posted a function above https://news.ycombinator.com/item?id=41288792 https://news.ycombinator.com/item?id=41288792
- leejoramo 2y agoI had to clean up the code a bit and move it to a public GitHub repository. https://github.com/leejoramo/macOS-plus-AHK https://github.com/leejoramo/macOS-plus-AHK As others have mentioned it is probably worth looking at Kinto to add macOS keyboard shortcuts to Windows. I started this project years before I learned about Kinto, plus I have most of my other system customizations in here. Currently my main workstation is KDE/Ubuntu where I use Toshy for the macOS shortcuts, and have customized the rest via KDE shortcut management and my hardware keyboard.
- firecall 2y agoThis is one of my essential quality of life tools: https://github.com/rbreaves/kinto https://github.com/rbreaves/kinto Decades of using the Mac convention of CMD instead of CTRL makes it hard to switch to CTRL. I get cramping super quickly when using Windows or Linux without Kinto! Of course, try explaining that to corporate IT who insist you use a locked down Windows PC... thank god I dont have to endure that anymore!
- kasabali 2y ago> ... CTRL. I get cramping super quickly The trick to CTRL is pressing it with your palm. http://xahlee.info/kbd/how_to_press_control_key.html http://xahlee.info/kbd/how_to_press_control_key.html
- firecall 2y agoYou know what, I'll try that! Save me contorting my little finger. Although I wish we could go back CTRL defaulting to where CAPSLOCK is!
- leejoramo 2y agoIf you love Kinto, you need to really look at the Toshy project. It is a fork of Kinto for Linux. The developer of Toshy is super active and responsive, and has moved the Kinto code to more modern technology. They have refactored the scripts to be much easier to customize and while allowing upgrade to new versions of Toshy. https://github.com/RedBearAK/toshy https://github.com/RedBearAK/toshy
- firecall 2y agoThanks! I'll check it out!
- quink 2y agoAnd conversely https://alt-tab-macos.netlify.app/ https://alt-tab-macos.netlify.app/ to keep your sanity on macOS. The things that annoys me most atm: when I have multiple VS Code windows, and my web browser, if I Cmd+Tab from my web browser to VS Code _all_ the VS Code windows pop to the foreground, even ones I'm not focusing. In other words, I can't write code and also be able to see the result at the same time. Just because I choose to have stuff I'm not working on that's completely irrelevant to the thing at hand being behind other things I am working on. Unless I spend time manually putting windows in non-preferred locations or closing things or doing things that are in no way related to the things I have visible and am working on right now at the moment. And if I minimise then I have to minimise again if I Alt+` through the application windows. It's just all so very very tedious on macOS. Wouldn't want to use it if it wasn't for work.
- dopu 2y agoThis behavior and macOS’s terrible default window management ultimately drove me back to Windows for serious work. I suppose I never fully adapted to the macOS way of doing things, but I never understood what they envisioned users were supposed to do here. Is the intended behavior that the user minimize any VSCode windows that are not currently in use? But then what if I have multiple windows open because the other has some reference codebase? Do I keep that in a separate desktop instead? It’s just perplexing.
- whatever1 2y agoIt is a windowing system built for one monitor and one desktop. Its metaphors broke completely once they added multi monitor multi desktop per monitor support. Even the menu bar does not make any sense when you have two monitors. Let alone the useless command tab that picks up whichever window (or not even a window) it wants
- happymellon 2y agoOnly Gnome does multi-desktop really well in my opinion. Unless Windows has fixed things, I found that windows alerting on an alternative virtual desktop could lock everything until I found the popup. There were plently of other sharp edges.
- smusamashah 2y agoI am not sure but having used AutoHotKey recently for a few qol things, it feels like AHK would be able to do this too.
- eviks 2y agoIt is able to do this, and it being Ahk, it's also more customizable
- deleted 2y ago[deleted]
- thrdbndndn 2y agoSince we are talking about window switching, a little rant: there are two common orders for switching windows/tabs: most recently used, and sequential. Some use the first one (e.g. Windows), some use the other (e.g. most browsers). They both have their merits, so people prefer one or the other. Yet, almost no software provide a toggle to customize this (Firefox does, but it has an even weirder quirk). I understand modern software can't have billions of settings for every single thing for (good) practical reasons, but deep in my heart, I'm still annoyed by the fact "we have all the technology, yet we still have to compromise to this".
- dustincoates 2y agoOddly enough, I much prefer recently used when switching windows and sequential when switching tabs. I'll note as well that Vivaldi offers the option to switch the behavior.
- somat 2y agoIt is probably what was learned where, muscle memory can be a strange thing at times. I, for instance, enjoy the vi editor, to the point that I have a hard time using emacs, however, I need the emacsish keybindings in my shell and don't like the vi keys there.
- saghm 2y ago> Oddly enough, I much prefer recently used when switching windows and sequential when switching tabs. Same! The key difference IMO is that with tabs, I can actively see all of them even before I hit the shortcut; being able to see the "distance" between my current tab and the "destination" makes me find linearly searching easier. With windows, I tend to almost always have things maximized on the monitor they're on, and when I have two monitors, I tend to split things by only having a single window on one monitor (keeping the rest all together). While there's generally a visual reference for swapping windows once you've hit the shortcut (but haven't released it yet), not having the context before I start taking action makes me less likely to know the exact order of my windows, so there's not really any order that would be helpful based on that. The only reason that recency order is somewhat useful for me is to be able to quickly swap back and forth between two apps (especially when I have a single monitor), and that's just not really how I use tabs.
- self_awareness 2y agoCompared to KDE, I have a feeling that both Windows and macOS have pretty primitive usability options. Windows got some improvements in this area only recently, but I think macOS is still behind. When I'm using macOS, I can't stand the GUI without these tools: Rectangle: https://rectangleapp.com/ https://rectangleapp.com/ Easy Move+Resize: https://github.com/dmarcotte/easy-move-resize https://github.com/dmarcotte/easy-move-resize They move the macOS desktop usability near the place where KDE was in the late 2000's.
- pjmlp 2y agoTwo things that KDE did/does better than Windows. The way thumbnails work, the whole KParts and D-Bus tooling infrastructure, versus COM that has hardly improved in any meaningfull way during the last 30 years. However market share and being better technically aren't directly related.
- badsectoracula 2y agoNeither KParts nor D-Bus are better than COM though. KParts is just some way to expose a Qt widget, at best comparable to something like ActiveX (a very specific use of COM, not the entirety of what you can do with COM), but even the functionality it exposes is limited. Hell, it might be closer to OLE 1 than even OLE 2. It feels like it was made by someone looking at a specific use of COM/OLE2 in some popular Windows application back in the 90s and decided that that's everything the tech is all about and can do - so you could probably make something like custom WordPad controls with it (though from the docs i don't see any way to store instance-specific data, so you probably can't even get OLE-like functionality) but you couldn't make something like, say, Visual Basic / VBA. Of course being written for Qt it is also inherently limited to be usable only in terms of C++ and with specific Qt versions, which certainly makes is less generic than COM. D-Bus is a bit closer to COM in that like COM it can be used to have a centralized registry of methods exposed via interfaces in objects to call, but is still also more limited in that it is only meant for passing messages across processes - you can't, e.g., use it to create a "decoder" object with a method you call from several threads in which you give it two memory pointers, one with a buffer of encoded bytes and another to place the decoded bytes into. The closest with D-Bus would be to communicate details for the decoding (perhaps via other IPC methods like shared memory, but that'd be outside of D-Bus itself), though with little control over how it is done. Also FWIW D-Bus has nothing KDE-specific in it (if anything it came out of the GNOME world). COM might have seen little improvement since Windows 95 but even COM in Windows 95 provides more functionality than what KParts or D-Bus do in modern Linux, so i wouldn't call the latter more technically advanced at all. The only benefit they have is being designed a few years after COM so they didn't had the constraint of having to run in systems with 8MB of RAM.
- nsonha 2y agoStockholm syndrome much? Why would the windows that I am multi-tasking on just coveniently belong to the same app for me to use this shortcut?
- etbebl 2y agoIt can be more efficient when combining both Alt-Tab and Alt-` - if you have several windows open in multiple different apps, it's easier to first Alt-Tab to the app you want and then Alt-` to the window you want rather than Alt-Tabbing through like 20 individual windows. That being said, I don't really strongly prefer one system over the other; the main cost is in switching between them and using the wrong shortcut for a while (more a problem on the OS with 2 shortcuts, i.e. Linux). This would be helpful to avoid that, but so would configuring whatever Linux windows manager I'm using to only use Alt-Tab.
- hiergiltdiestfu 2y agoThanks for making this, but small note: On QWERTZ, backtick ` is: a dead key, situated left of backspace, and it's in the "upper row", too. So there the combo is actually Alt+Shift+´+Space, in need of two hands - it's very hard to imagine a worse default key combo choice for this task, compared to Alt+Tab. I'm glad you made it configurable. Fun fact: one of the first public drafts for multi-line Strings in Java expected the delimiter to be ```, until I pointed out the issue as above to Brian Goetz at JAX in Mainz where he had presented said draft. My proudest professional moment. Take away: If you deal with keyboard magic and ergonomics, spend a couple minutes to check your assumptions behind your defaults in the other big keyboard layouts.
- Kichererbsen 2y agothis. i'm on the swiss german keyboard layout. backticks are hard to do as a keyboard shortcut. they barely work as a character (e.g. for markdown formatting) but with a bit of pracitce that _does_ work. try getting default vim bindings to work on a swiss german keyboard... i eventually gave up.
- Twelveday 2y agoI'm in the same boat as you and after 15 years of coding I finally switched to the US layout 3 weeks ago. Got a Wooting 60HE and installed the EuroKey layout and so far I'm super happy about the switch and many default shortcuts make a lot more sense (e.g. no more acrobatics needed for ctrl+b+[ to enter tmux copy mode). The first few days are a little rough to unlearn all the muscle memory but I found this neat site to practice typing with your own public gists: https://www.codetyper.io/ https://www.codetyper.io/
- nrr 2y agoI've long used the US international layout with Alt-Graph deadkeys. (For the full experience, you can perhaps buy an ANSI format keyboard from the Netherlands?) It takes some practice getting AltGr+y as ü and AltGr+w as ä and AltGr+p as ö into your muscle memory, let alone AltGr+circumflex instead of just circumflex to get the dead key (raison d'être requires AltGr+Shift+6 to type properly), but I've found it's otherwise a remarkably workable tradeoff.
- bmacho 2y agoAnyone has a working AutoHotKey script for same program window switch on Windows? The same way how Ubuntu Unity works. Last one I used didn't work with File Explorer (since it is the same program as the Desktop), and I couldn't make it work, and it was more annoying than useful at the end.
- davisoneee 2y agoI've posted a function which should handle this https://news.ycombinator.com/item?id=41288792 https://news.ycombinator.com/item?id=41288792 and you can bind it to whatever key you like. I remember vaguely having the same explorer-window issue as you mentioned, which is why I use both the Active Class and Active Exe of the current window.
- davisoneee 2y agoFor those mentioning autohotkey, this is what I use when on windows do get the same functionality: CycleCurrentApplication() { ; {{{1 curID := WinGetID("A") ActiveClass := WinGetClass("A") ActiveExe := WinGetProcessName("A") oList := WinGetList("ahk_exe " ActiveExe " ahk_class " ActiveClass,,,) Loop oList.Length { index := oList.Length - A_Index + 1 State := WinGetMinMax("ahk_id " oList[index]) nextID := WinGetID("ahk_id " oList[index]) if (State != -1) ; if window not minimised { WinID := oList[index] break } } WinActivate("ahk_id " WinID) } ; }}}1 the 'activeclass' AND 'activeexe' are there to handle cases like explorer. I primarily use this for multiple instances of firefox (although I've got specific binds to jump directly to non-media and media firefox)
- politelemon 2y agoIn Gnome (I think?) I am able to scroll over an application icon to switch between same application windows. Is this possible in Win11?
- Springtime 2y agoFor years I used a freeware utility called VistaSwitcher for this. Could similarly customize the hotkey and also allowed changing the Alt-Tab menu to be a quicker-to-parse text based list instead of the giant thumbnails Windows uses by default. The Mac way of cycling within the same program is very useful and one of the things I like borrowing when using Windows, as accidentally Alt-Tab'ing to a different program when there are multiple windows open from one source (eg: text editor) becomes annoying.
- delta_p_delta_x 2y agoCool project. Even after the improvements in Windows 10 and 11, windowing could do with some work, which spurs projects like this (ironic given the OS is called Windows). I hardly use Alt-Tab. I use Windows-Tab instead, and in the resulting Task View, mouse over to the window I need. I've bound that keyboard shortcut as well as Ctrl-Windows-Left and Ctrl-Windows-Right (switch virtual desktop left or right) each to a different mouse button which makes things so much more productive. I've got a wireless Logitech G502x with about seven buttons on it, best mouse investment ever. After RDPing to my home workstation on a MacBook I realised how much my productivity collapsed if I don't have access to that mouse.