This is my third attempt at migrating the dev environment from Mac to Windows. I used to develop on Mac for 5 years. With all my muscle memory on keymaps, productivity tools, and the general UX is stuck to Mac, I can’t think of moving to another OS, until the quarantine day. I got locked down at home for a month, and my 2017 Mac started to slow since I started C# development with Rider. And I have my gaming PC stay here just for Doto2.
The first attempt a year ago was about native app prebuild for Windows like nvim-qt, vscode, Windows terminal… I quit after a few days cause I missed my keymap.
After a few months, the second attempt is about WSL, this time I dug deeper into the real command-line tools like curl, git, grep, gcloud, kubectl, autojump… And I was too lazy to learn the powershell way to do it, then I went with WSL. And you know what, WSL sucks with a ton of troubles while installing and using it through a Windows terminal.
And this time is the third.
I have to accept that I can’t make the experience on Windows exactly like Mac. Since I know how to live with compromise, I know how to deal with this situation. Besides, I don’t want to be a sheeple that sticks to every generation of Mac even when it sucks. So, the first thing that comes to mind is to learn to compromise.
The editor
The most frustrating thing with Windows is I can’t config Vim — my favorite editor exactly like what I have in Mac. For example, I have Karabiner Elements to map jk to ESC, it’s super productive while the escape is right at your finger, but I don’t have it here. Fzf is experimenting on Windows, it’s buggy and doesn’t work at all in my case, The Windows terminal is not very good with Vim running inside…
I have to config Rider and Vscode as much as I can, compromised with something missing.
The command-line tools
Git is the second most important tool. I have several alias functions for git, which combine several commands in one function which helps save time on repetitive tasks. It works on whatever shells except for Powershell… So I have to learn the PowerShell way and transform those commands one by one, like this: It is quite similar to bash shell syntax but it still needs some research and transforms all of them. I have like 10 frequently used commands like that, e.g., tagging, rebasing, showing log, pull with rebase… for example, git merge to master
function gmerge() {
$CURRENT_BRANCH = & invoke-Expression gcurrent 2>&1
$TO_BRANCH="master" "> Merging $CURRENT_BRANCH -> $TO_BRANCH" "> git checkout $TO_BRANCH"
git checkout $TO_BRANCH "> git merge --no-ff $CURRENT_BRANCH"
git merge --no-ff $CURRENT_BRANCH "> git commit -m 'Merge branch $CURRENT_BRANCH'"
git commit -m "Merge branch $CURRENT_BRANCH" "> git push origin $TO_BRANCH"
git push origin $TO_BRANCH "> Delete $CURRENT_BRANCH branch from local"
git branch -D $CURRENT_BRANCH
}
For the other command, Windows has scoop
, it will install the prebuilt CLI program which works similarly to the program on Linux or Mac. If Scoop doesn’t have that, MSYS2 comes to the rescue. The most frequently used are curl, gcloud, autojump, grep, cat, tail, pwd… So far the command line is quite the same.
The terminal
Windows doesn’t have much choice on the terminal app, cause most of them are ugly af. Windows terminal so far is the best, with true color, tab, and pannel support, able to open all kinds of shells.
It still needs a lot to improve but at least it is good enough for now.
Productivity tools
Window management
I introduce you to PowerToys, a series of productive tools for Windows. There is a tool named FancyZones that helps to split the windows by the predefined layouts. But I found it’s kind of complex to use, a hundred times harder to use than my favorite tool on Mac named Spectacles. So the basic default Win + up/down/left/right is enough for me.
If you want to press the Space key to preview a file, there is a tool named QuickLook on the Windows Store that can help.
Spotlight search
PowerToys also has a tool PowerToys Run, which searches for file, application, and calculator, runs a shell command, opens a URL, and runs a window command.
Key remapping
PowerToys Keyboard Manager can help to remap the simple keystrokes. I don’t want to relearn the memory muscle so that I map all the familiar keystrokes like alt+c, and alt+v to ctrl+c, ctrl+v, and so on.
I also use the F keys to quickly launch the app, which is super productive for me. For example, I usually switch between Chrome, Terminal, Vim, and Postman for development, mapping it directly to F1, F2, F3, and F8… check out my AutoHotkey dot file
F1::
if WinExist("ahk_exe chrome.exe",,"Picture-in-Picture")
WinActivate
returnF2::
if WinExist("ahk_exe code.exe")
WinActivate
returnF3::
if WinExist("ahk_exe WindowsTerminal.exe")
WinActivate
returnF4::
if WinExist("ahk_exe rider64.exe")
WinActivate
returnF5::
if WinExist("ahk_exe firefox.exe",,"Picture-in-Picture")
WinActivate
return!F5::
if WinExist("ahk_exe telegram.exe")
WinActivate
returnF6::
if WinExist("ahk_exe discord.exe")
WinActivate
returnF7::
if WinExist("ahk_exe Slack.exe")
WinActivate
returnF8::
if WinExist("ahk_exe Postman.exe")
WinActivate
returnF9::
if WinExist("ahk_exe pritunl.exe")
WinActivate
returnF10::
if WinExist("ahk_exe clickup.exe")
WinActivate
return
Conclusion
It is not the end of the road yet, I just switched to Windows for a few weeks, and the post will be updated. Checkout my dotfiles for more detail: https://github.com/finnng/dotfiles
There are something still make me uncomfortable, my favorite editor is NeoVim but it is not fully working on Windows yet, my favorite fzf.vim still unstable and buggy which prevents me from using it as a daily driver. There are no Apple Photos, iMessage, Notes, and other productivity apps that belong to the Apple ecosystem available here. I have to compromise because the computer power is huge compared to my Macbook Pro. I think a big Mac Pro with 28 cores and 64 GB of RAM will resolve all the trouble above.