Mac commands in VSCode: A requiem for Windows
Tags: productivity, vscode, beginners, codenewbie
Published: 2020-01-26 18:08:32

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.

![Alt Text](https://media.giphy.com/media/4MwP0n2iPbkcM/giphy.gif)

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! 

![Alt Text](https://media.giphy.com/media/fV1ItQHFSgnzkqzVGt/giphy.gif)

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!

![Alt Text](https://media.giphy.com/media/3o84U2nxUHPzsyHIbu/giphy.gif)

What are some of your favorite keyboard shortcuts to aid in productivity?