Mac commands in VSCode: A requiem for Windows
Jill
Posted on January 26, 2020
Recently I made the switch from a Windows operating system to a macOS, and while it's probably contrary to popular opinion, I still love and prefer Windows! I grew up on hand-me-down Dell's so I admit, I'm completely biased. I've worked with Macs on occasion for jobs in the past so the switch wasn't a total culture shock, but I never really took to mac's interface, and therefore have never worked with one personally or extensively until a few weeks ago.
Now, in a learning environment riddled with apple products and their seasoned users, I find myself in unfamiliar territory, and showing off my noob-ness when I accidentally still try to use Windows commands out of muscle memory. The most common mistake I make in running commands in Mac is pressing the control
button to when I intend to press the command
button. In the pressure of the moment, (because of course it always happens when I'm pair programming) I often forget which one actually works for which operating system.
So I came up with a little alliteration to use when these moments happen, to remind me what goes where:
co[n]trols are for wi[n]dows, co[mm]ands are for [m]acs.
Sure it's simple and silly but when I'm trying to think and work fast, this little reminder helps me out! The list of pure mac commands is extensive and of course I still haven't mastered it but to be honest, I do most of my work in VSCode anyway and find myself using keyboard shortcuts (sometimes Windows ones, doh) in that environment all the time, so for my fellow windows users who may have also recently made a switch, I've drummed up this abbreviated list of some of my favorite commands.
wink
VS Code Command Cheat Sheet
⌘
This symbol denotes the use of the mac's command button, again, for the seasoned mac user, this is probably obvious and second nature at this point, but after 20+ years of working on PC's, this is something that trips me up often.
Code Editing
⌘X: Cut (+ Shift for individual character/ line control)
⌘C : Copy (+ Shift for individual character/line control)
⌘S : Save
⌘/ : Comment out an entire line or create a line comment
(+ Shift over multiple to comment out multiple lines at once)
⌘L : Select an entire line
⌘D : Select every word in the file that matches current line input
File Navigation
⌘F : Pops open a text bar to (F)ind the searched text in a file
⌘X + Up Arrow / Down Arrow : Jump to the Top/End of a file
⌘ Backslash : Hide/Show Side Explorer Navigation
control + BackTick : Hide/Show Terminal
⌘P : Quick Navigation (Drop Down Nav that lists all files)
⌘ + Shift + P : Opens the Command Palette
⌘K: This one is really cool because it's designed to wait for a second command called a chord
.
These are some of my favorite ⌘K combos:
⌘K⌘T : Opens the theme list to allow for a quick change of editor view
⌘K⌘X : Trims all the trailing white spaces. I love this command. If you're like me and struggle with formatting, this one is super helpful when linting your files.
⌘K⌘Z : Toggle Zen Mode
⌘K⌘S : If all else fails and you still find yourself using Windows commands, this handy shortcut lets you change commands to be what you want!
I wrote this because I often work with Mac users who I chuckle with when I stumble over keyboard shortcuts. While I may be incredibly fond of PC's, I also consider it a wonderful skill to be able to utilize a myriad of tools as a fullstack software engineer, shortcuts being one of them.
Keyboard shortcuts are important for productivity on any operating system, by leveraging them we optimize our own performance which in turn can even have an impact on the quality of our code. The longer we can keep our hands on the keys, the more successes and failures we can work through in a shorter amount of time.
Do yourself and your fellow co-workers a favor and get comfortable with keyboard shortcuts, (even if it means 'importing' some commands from another OS!) doing so will help ease the iteration towards the final goal.
Thanks for reading!
What are some of your favorite keyboard shortcuts to aid in productivity?
Posted on January 26, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.