# 10 VS Code shortcuts to memorize that will boost your productivity

<div class="lead-paragraph"><span class="dropcap">T</span>here are a handful of VS Code shortcuts that I use daily to boost productivity and overall efficiency. Here are 10 that you can memorize and incorporate into your workflow today.</div><div class="max-w-4xl mx-auto px-4 sm:px-6 pt-4">             <div class="border-t dark:border-slate-700"></div>           </div>

<p>Note: I'm not "anti-mouse" so this list will include some mouse clicks. Sure using your keyboard exclusively is a noble pursuit, but on a Macbook my mouse is "right there." Why not use it also?</p>

<h2>10 VS Code shortcuts that will boost your productivity</h2>

<h3>1. Command Palette</h3>

<p>The command palette is one of the most foundational of all VS Code shortcuts. It's the shortcut that gives you access to all of the functionality of VS Code.</p>

<figure class="textcenter"><img src="https://travismedia.gumlet.io/public/images/2019/12/vs-code-shortcuts-command-palette-comp.gif" alt="vs code shortcuts command palette comp" /></figure>

<p class="has-background"><strong>MacOS:</strong> Command + Shift + P<br><strong>Windows:</strong> Ctrl + Shift + P</p>

<h3>2. Duplicate Line Down/Up</h3>

<p>This is a shortcut I use a lot in my workflow to boost productivity. Basically, you can take a line of code and duplicate it on the line above or below. This is helpful with single lines like &lt;li> tags and also with whole blocks of code like a CSS block or JS function.</p>

<figure class="textcenter"><img src="https://travismedia.gumlet.io/public/images/2019/12/vs-code-shortcuts-duplicate-line-comp.gif" alt="vs code shortcuts duplicate line comp" /></figure>

<p class="has-background"><strong>MacOS:</strong> Shift + Option + Up / Shift + Option + Down<br><strong>Windows:</strong> Shift + Alt + Up /&nbsp;Shift + Alt + Down</p>

<h3>3. Move Line Down/Up</h3>

<p>Similar to the shortcut above, this moves the line of code up or down. Again, helpful with single lines like reordering &lt;li> tags as well as blocks of code.</p>

<figure class="textcenter"><img src="https://travismedia.gumlet.io/public/images/2019/12/vs-code-shortcuts-move-line-comp.gif" alt="vs code shortcuts move line comp" /></figure>

<p class="has-background"><strong>MacOS:</strong> Option + Up / Option + Down<br><strong>Windows:</strong> Alt + Up / Alt + Down</p>

<h3>4. Indent / Outdent Line</h3>

<p>Another of the very helpful VS Code shortcuts and one to memorize. When you copy and paste something in Visual Studio Code, it doesn't always line up right (actually it rarely does). This shortcut allows you to indent or outdent a line or even an entire block of code.&nbsp;</p>

<figure class="textcenter"><img src="https://travismedia.gumlet.io/public/images/2019/12/vs-code-shortcuts-indent-comp.gif" alt="vs code shortcuts indent comp" /></figure>

<p class="has-background"><strong>MacOS:</strong> Command + ] / Command + [<br><strong>Windows:</strong>&nbsp;Ctrl + ] / Ctrl + [</p>

<h3>5. Multi-Select Selection</h3>

<p>So you decide to change all of the H3 tags on your template to H4 tags. So you go through and select each one and change it? No. You multi-select them all and change them all in one take.</p>

<p>In that example, you would highlight just one H3 tag, and as you hit the shortcut below it goes through and selects the other instances of that tag, providing you an active cursor with each one.</p>

<p>Of all the VS Code shortcuts this is one of my favorites and will boost your productivity.</p>

<figure class="textcenter"><img src="https://travismedia.gumlet.io/public/images/2019/12/vs-code-shortcuts-multiselect-comp.gif" alt="vs code shortcuts multiselect comp" /></figure>

<p class="has-background"><strong>MacOS:</strong> Command + D (to select next occurrence(s) after you make an initial selection)<br><strong>Windows:</strong>&nbsp;Ctrl + D (to select next occurrence(s) after you make an initial selection).<br>* There is a shortcut to select ALL occurrences, but I like to go through them one by one to be sure I want to change that one.</p>

<h3>6. Multi-Select Cursor</h3>

<p>Similar to the above, instead of selecting the next occurrences of a selection, you can place your cursor in multiple locations, and make edits to all and one time.</p>

<figure class="textcenter"><img src="https://travismedia.gumlet.io/public/images/2019/12/vs-code-shortcuts-multi-select-cursor-comp.gif" alt="vs code shortcuts multi select cursor comp" /></figure>

<p class="has-background"><strong>MacOS:</strong> Option + Click<br><strong>Windows:</strong>&nbsp;Alt + Click</p>

<h3>7. Toggle Line Comment</h3>

<p>So we use line comments to "disable" a line or block of code or HTML or CSS right?</p>

<p>This Visual Studio Code shortcut allows you to disable a line or block of code by commenting it out. You can also use it again to re-enable that line or block of code by removing the comment markup.</p>

<figure class="textcenter"><img src="https://travismedia.gumlet.io/public/images/2019/12/vs-code-shortcuts-comment-disable-comp.gif" alt="vs code shortcuts comment disable comp" /></figure>

<p class="has-background"><strong>MacOS:</strong> Command + /<br><strong>Windows:</strong>&nbsp;Ctrl + /</p>

<h3>8. Show / Hide Terminal</h3>

<p>I almost exclusively use the VS Code Integrated terminal and rarely ever the OS Terminal. So of all the VS Code shortcuts, this is especially useful for me and for you if you do the same.</p>

<figure class="textcenter"><img src="https://travismedia.gumlet.io/public/images/2019/12/vs-code-shortcuts-toggle-terminal-comp.gif" alt="vs code shortcuts toggle terminal comp" /></figure>

<p class="has-background"><strong>MacOS:</strong> Control + ̀<br><strong>Windows:</strong>&nbsp;Ctrl + ̀</p>

<h3>9. Add Line Comment</h3>

<p>Adding a line comment to HTML and CSS is somewhat cumbersome to type out.&nbsp;</p>

<p>Thankfully VS Code has a shortcut to pop it in there for you. Use your right hand to hit the K and left to hit the C while holding Command.</p>

<figure class="textcenter"><img src="https://travismedia.gumlet.io/public/images/2019/12/vs-code-shortcuts-comments-comp.gif" alt="vs code shortcuts comments comp" class="wp-image-6710"/></figure>

<p class="has-background"><strong>MacOS:</strong> Command + K Command + C<br><strong>Windows:</strong>&nbsp;Ctrl + K Ctrl + C</p>

<h3>10. Toggle Sidebar</h3>

<p>Of all the VS Code shortcuts, this is another major one for me. I don't like that sidebar there when I'm writing code. At the same time, when I need it back, I want it back with ease.</p>

<figure class="textcenter"><img src="https://travismedia.gumlet.io/public/images/2019/12/vs-code-shortcuts-toggle-sidebar-comp.gif" alt="vs code shortcuts toggle sidebar comp" /></figure>

<p class="has-background"><strong>MacOS:</strong> Command + B<br><strong>Windows:</strong>&nbsp;Ctrl + B</p>

<h3>More Info</h3>

<p>Visual studio code can be downloaded <a rel="noreferrer noopener" aria-label="Visual studio code can be downloaded at the website. (opens in a new tab)" href="https://code.visualstudio.com/download" target="_blank">at their website</a>. It's my favorite code editor and I use it exclusively. I found Brackets to be not quite enough for what I need, Atom to be super slow and bulky, the JetBrains IDEs too expensive, and Sublime isn't free. Also, VS Code is a full IDE, is packed with loads of features, and extensions, is free, and thankfully&nbsp;open source.</p>

<h3>Conclusion</h3>

<p>Take the time to memorize these VS Code extensions and incorporate them into your workflow. You will surely find a boost in your productivity and your efficiency as a programmer.</p>

<p class="has-background">Related Post:<br><a href="/key-features-of-visual-studio-code-that-coders-should-be-using">Key Features of Visual Studio Code That Coders Should Be Using</a></p>