1. 11

I am about to start a new software engineering position where most folks have Windows machines. I’ve been using a Mac for development and Linux for deployment for over a decade, and am feeling clumsy in Windows without my standard tools like Alfred, Dash, SizeUp, and muscle memory for countless shortcuts.

I’ve discovered Launchy so far as an alternative to Alfred, and look into WSL for a Linux environment.

What are your recommendations for becoming productive in a Windows environment?

  1.  

  2. 7

    take a peek at Microsoft PowerToys, esp. the Run tool, for some useful utilities that are actively updated.

    probably also consider using the new Windows Terminal that’s also actively developed.

    1. 3
    2. 7

      Welcome to Windows! I’ve used it as my only OS since late 2019 and have grown pretty fond of the damn thing. It’s been a while since I did Macs, though, so I’ll focus on general QoL stuff.

      • Winget: This is the official package manager. Comes default with the winget source, which is pretty good, and the msstore source, which is complete trash. Remove it.
      • WinAero Tweaker: A nice UI over common registry edits, so you can do things like remove all the ads from windows and go back to the old menus and stuff.
      • ShellMenuView/ShellExtView: Clean up the right-click menu from all the cruft installed programs can add.
      • Ditto Clipboard Manager: Libre and very good. Fast and packed with useful features, like editing clips, group storage, and disabling copy from specific apps.
      • FancyZones: I’ll be honest the virtual desktop situation on Windows really sucks, this tool is ok I guess
      • Powershell: It’s more intimidating than bash, but also a lot more powerful. Here’s how easy it was to write my own file watcher. It’s also real simple to add dynamic tab completion to the arguments of existing functions, and you can query functions/aliases/environment values/variables with the same commands as you would files (via providers).
      • AutoHotKey: AHK is old, janky as hell, and completely justifies using Windows. It’s a combination of KeyboardMaestro, Alfred, Karabiner, Automator, Hammerspoon, and Applescript,, while also being completely free and open source. it’s the easier way to reproduce a lot of your keyboard shortcuts. But once you get comfortable you can do some really fancy stuff. Pressing the del key on my numpad toggles “workshop mode”, which activates a dozen hotkeys, some of which are also tied to specific applications. AHK is great. Learn AHK.

      rn I’m looking at Power Automate, which now comes default with Windows 11, but I haven’t been impressed so far.

      1. 2

        I used AHK extensively before my Mac days. Wonderful piece of software! Happy to hear it is still relevant.

        Thanks for the recommendations.

        1. 3

          Lemme know if you have any questions, I love upskilling people on AHK

          1. 1

            It’s ok, but if you want more control AutoIt is better. Then again, Ms released “power automate” which provides a much more friendly interface for this idea.

            However, if you want to write something more complex, writing actual C# code using FlaUI is still the winner for me.

          2. 1

            I hear so many good things about PowerShell, and the scripts I see are pretty rad, like yours! But I’m already so productive in zsh and bash is everywhere. I wish I had a justification to learn PS to make me do it.

          3. 7

            I’ve used a Mac for about 20 years now and I’ve never heard of any of those tools. It would help if you could tell us:

            • What kind of development you do. Cocoa, UNIX, and web development on macOS, for example, tend towards very different tooling.
            • What the tools that you use actually do.

            I use Windows at work and a Mac at home. In both, I write code in vim, just in a different terminal. I use basically the same tooling for both, with a few small localisations (e.g. choco vs brew), but I suspect my use case (mostly systems programming) is very different from yours.

            1. 2

              Thanks for saying that, because I thought the same thing and was puzzled.

              1. 1

                This is a great point, thank you for raising it.

                Development

                Here are areas in decreasing order of relevance:

                1. Process TB or PB of data for analytics or simulation. Not database development, but a user of databases.
                2. Fairly performant transactional processing, e.g. handle up to hundreds of thousands of requests/second in 10s or 100s of millis.
                3. Low traffic backoffice-style applications, the backend part.

                These applications are deployed to “the cloud”, not installed on a user device.

                Tools (local ones, not things I use through a browser)

                • Coding: I use vim the majority of the time, with the rest split between VS Code or IntelliJ. vim is the best editor; vscode and intellij have convenience IDE features.
                • Clipboard management (multi clipboard): Alfred
                • Documentation: Dash, usually queried through Alfred. cheat on the command line for community and personal reference docs. tldr, cht.sh, howdoi as a nicer command-line way to search the hive mind for examples of using command-line tools.
                • Shell/terminal: bash and iTerm. Previously used screen then tmux until iTerm’s convenience took over.
                • Command-line tools in my recent history: fzf, nettop, curl, diff, awk, fd, duf, dust, nc, xargs, ssh, git
                • Package management: homebrew now, after switching from macports
                • “Remote development”: vim on the remote server, or mount with sshfs and vim or vscode locally
                • More language-specific package management: sdkman, python venv, npm with nvm
                • Data exploration: visidata, jupyter notebook with pandas, csvkit tools, sqlite
                • App launcher and custom workflows/shortcuts: Alfred
                • Calculator: Alfred for simple things, Soulver for more involved scratchpads, sometimes bc -l or the python shell
                • Notes and reminders: odd but effective-for-me mix of AquaMacs with org-mode, Things 3, default Reminders and Notes apps

                Edit: I like to be on the keyboard as much as possible, and on the trackpad or mouse as little as possible. My caps lock key has been remapped to ctrl for as long as I can remember.

                1. 1

                  Data exploration: visidata, jupyter notebook with pandas, csvkit tools, sqlite

                  This might sound bugnuts crazy, but consider giving Excel (yes, that Excel) a shot.

                  1. 1

                    It sounds as if your Mac usage is pretty similar to mine (though I prefer the Apple terminal to iTerm: I had iTerm crash too many times with 20+ open windows, losing all of their state, to trust it and all of the features that I actually liked ended up in Terminal.app with more polish).

                    Coding: I use vim the majority of the time, with the rest split between VS Code or IntelliJ. vim is the best editor; vscode and intellij have convenience IDE features.

                    I use vim in the Windows Terminal. Make sure that you have the one installed from the Windows Store (or from GitHub - it’s open source). I tend to use the preview release (also available on the store), because the dev team is super responsive to bug reports and I can always fall back to the non-preview version if a bug is a show stopper (I found one recently where coloured text didn’t work if you used an older version of Source Code Pro, which had buggy SVG colour tables, as your terminal font).

                    The one feature that I miss from Terminal.app is preserving the UUID that it sticks in an environment variable across restarts. I don’t do that much locally and I use this in my .bashrc to reconnect a terminal to a remote session if there’s a file storing the connection config for that UUID. This means I can reboot my Mac and resume all of my remote terminal sessions.

                    Shell/terminal: bash and iTerm. Previously used screen then tmux until iTerm’s convenience took over.

                    I use WSL1, which is similar in nature to the FreeBSD Linux compat layer. WSL2 is a Linux VM with a load of integration services. WSL2 has much better Linux compatibility (it is Linux), WSL1 is more lightweight. WSL2 relies on the balloon driver to grow memory and so things that rapidly allocate memory can often crash because Linux doesn’t treat the balloon driver as special and so will fail allocations if it can’t grow them fast enough. WSL2 exposes a block device with an ext2 filesystem for the Linux FS and exposes the Windows FS via 9p-over-vmbus. WSL1 uses NTFS filter drivers for both. This means that accessing the Linux bit of the FS is much faster in WSL2, but accessing the Windows bit is slower. I mostly use WSL to run git, vim, and ssh, so the speed hasn’t bothered me.

                    Either gives you an environment that isn’t too different to the Mac terminal environment. There are a few useful tools, such as wslpath for converting between Windows and Linux paths (for interop between the two worlds). You can run Windows programs directly from bash (e.g. explorer.exe . to open a graphical file browser in the current directory). The Linux FS is exposed in more or less the same way that network filesystems work in Windows via UNC paths.

                    This also includes running cmd.exe from bash. I have these aliases set up:

                    alias vs='cmd.exe /K "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"'
                    alias vs32='cmd.exe /K "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars32.bat"'
                    

                    These let me drop into a DOS-style command prompt with all of the environment variables set up for invoking the 64-bit or 32-bit Visual Studio tools. With this, I can then run cmake-gui to configure things to use Visual Studio’s compiler chain to build.

                    Command-line tools in my recent history: fzf, nettop, curl, diff, awk, fd, duf, dust, nc, xargs, ssh, git

                    These should all Just Work in WSL (1 or 2). Not sure what nettop will do. In WSL2 it will just tell you what the Linux VM is doing. In WSL1, it might not work.

                    Package management: homebrew now, after switching from macports

                    I use chocolatey. winget exists as well and is apparently similar.

                    “Remote development”: vim on the remote server, or mount with sshfs and vim or vscode locally

                    ssh and vim work well from WSL in the Windows terminal (I spend most of my time in a FreeBSD VM on Hyper-V, connected via ssh). They also work well from PowerShell with no WSL. The Windows builds of git come with a nice build of bash that runs without WSL as well. I don’t know about sshfs, I have heard of one colleague using sshfs from WSL2 and then using it from Windows (which then gets the filesystem via 9p-over-vmbus). That has a lot of overhead, but apparently works.

                    More language-specific package management: sdkman, python venv, npm with nvm Data exploration: visidata, jupyter notebook with pandas, csvkit tools, sqlite

                    All of these should work in WSL. I think most of them also have native versions.

                    Calculator: Alfred for simple things, Soulver for more involved scratchpads, sometimes bc -l or the python shell

                    I’ve not used Alfred. The Windows calculator has basically the same feature set as the macOS one. With PowerToys there’s also a spotlight-like thing, which I tend to use for simple things (alt-space and type the sum) just as I used the spotlight pop-up on macOS (command-space and type the sum).

                    A few other people have mentioned PowerShell. It’s also available for macOS and Linux. If you have WSL, you can end up with two versions. I have a shell script called wps in my WSL path, which looks like this:

                    #!/bin/sh
                    FILE=`wslpath -a -w $1`
                    shift
                    exec powershell.exe -File ${FILE} $@
                    

                    This translates the path of the first argument to a Windows UNC path and then invokes the Windows version of PowerShell with that as the script argument and passes all of the other arguments. The fun thing is that you can then use this in the shbang for other scripts, so in WSL I can write a shell script that starts #!/path/to/wps and then write PowerShell scripts that I can run from WSL’s bash and get access to any of the rich interfaces that PowerShell exposes (using Azure with PowerShell is so much nicer than any of the other client options, for example, so I use PowerShell things to start and stop VMs).

                2. 6

                  Scoop is a wonder in a sea of Windows package managers.

                  1. 2

                    I second this recommendation.

                    scoop install emacs brave git python3 vscode mobaxterm libreoffice putty openjdk pandoc

                    Windows Terminal (to get TMUX-like behaviours and more): https://apps.microsoft.com/store/detail/windows-terminal/9N0DX20HK701?hl=en-us&gl=us

                    Overall, I try to keep my ‘shortcut’ perimeter close to Emacs. Which is why I tend to use dired, tramp, as directory navigation tools (local and remote). This helps me to work on BSDs, Linux, Windows, etc , in terminal mode.

                    Since you prefer OS-specific hot keys, for windows there is https://www.autohotkey.com/

                    (although I do not use it, so I do not know how close it is to Alfred’s hot-key based workflows)

                  2. 5

                    Zeal is an excellent Dash alternative on Linux and it has a Windows port too: https://zealdocs.org/

                    1. 4

                      Set your capslock key to ctrl on your windows boxes, and cmd on all your macs.

                      1. 1

                        Set it to ctrl+escape is the best :)

                        1. 1

                          Heathen!

                      2. 3

                        SizeUp: On macOS I moved to Rectangle, but used SizeUp for a long-time. I bought an AquaSnap license a long time ago and it serves my needs. Windows now has more hotkeys and virtual desktop stuff I don’t really use since I have my setup the way I want it.

                        Dash: Zeal and Velocity were the top equivalents when I last checked. Compared to window management, this area had fewer options because most people tend to open a browser rather than use a specialist tool.

                        As @williballenthin stated, PowerToys and Windows Terminal are also essential. You want to be on Windows 11 for the best experience going forward. Windows 10 users have been frustrated about some changes, but things are gradually reappearing.

                        1. 3

                          You want to be on Windows 11 for the best experience going forward

                          No, you don’t. They haven’t even managed to fix the taskbar yet. Wait for 12 and stick with 10 for now.

                        2. 2

                          When I ditched macOS many years ago, one of the things I missed most dearly was the ability to switch backwards and forwards between windows of the same app (cmd + tilde/backtick). I ended up writing a daemon that brings that functionality to Windows, you might also like it: https://neosmart.net/blog/2022/easy-window-switcher-1-3-0-released/

                          1. 1

                            That seems pretty useful! Here’s me trying to reproduce that in AHK:

                            !`::
                            WinGet, CurrExe, ProcessName, A
                            WinActivateBottom % "ahk_exe " . CurrExe
                            return
                            

                            Unfortunately it only goes one way, due to limitations on how WinActivate works. I might be able to get around that by doing something fancy with WinGet,, List but this seems alright for a quick spike.

                            1. 2

                              Nice and short! I’m assuming it works across processes? Does that exclude minimized windows from consideration (or can it be modified to do that)? I had to do that to mimic macOS behavior. Also, getting it to work with virtual desktops (not calling up windows of the same app from another VD) required an update when Windows 10 added that functionality out of the box.

                          2. 1

                            I haven’t touched it lately, but I keep a spreadsheet rooted around Mac workflows (and apps) I’ve liked to help with switching to Linux and noting Windows apps as well: https://docs.google.com/spreadsheets/d/148zTJUwfVv9xfDcpSoH3mF-c4vqV3CqyEWXuqaAiXoA/edit?usp=drive_web&ouid=115795755008503287756

                            1. 1

                              Wincompose is another important one for me. Install it with scoop: scoop install wincompose. I’m very accustomed to macOS option key special characters and know them well enough in Linux to use the compose key effectively. Wincompose adds sorely needed missing special characters functionality to Windows, which without necessitates memorizing the alt+0000 codes or keeping a table on a notecard nearby.