In this case, you should know that code snippets are simply pieces of frequently used code that you can insert via a shorthand. You've probably used at one point or another code snippets made by someone else, but maybe you've never used one before. These are my favorite shortcuts, but I strongly recommend that you take a quick look at the shortcuts list provided by VS Code to find out if others could make your life easier:Ĭlick here to access VS Code Keyboard shortcuts for macOS.Ĭlick here to access VS Code Keyboard shortcuts for Windows. ? Sometimes I even use it to edit code on multiple lines! ⌘D (MacOS) | Ctrl+D (Windows): It is a must-know because, well first, it adds to your cursor selection the next match, but also it helps you avoid stupid errors for when you need to change that selection, and you miss that one match.⇧⌥↓ / ⇧⌥↑ (MacOS) | Shift+Alt + ↓ / ↑ (Windows): A bit similar to the last one in the sense that it copies a line or a selection AND THEN pastes it below or above where you positioned your cursor. ⌥↓ / ⌥↑ (MacOS) | Alt+ ↑ / ↓ (Windows): Moves a line or a selection up or down from where your selector is positioned.
Shortcuts: Move or Duplicate a Line, Up or Down ? But maybe, you didn't notice that in VS Code, you could cut/copy an ENTIRE line without selecting it? ? If you don't already select the chunk of code you want to cut or copy, the editor will automatically cut/copy the line of code where you positioned your selector. ⌘X (MacOS) | Ctrl+X (Windows): Please don't judge! I know you know cut/copy and paste.⌃G (MacOS) | Ctrl+G (Windows): One more for the road, this one gets you right to the line number you need to edit. ⌃- / ⌃⇧- (MacOS) | Alt+ ← / → (Windows): Wanna move up and down from two specific locations in a breeze? We got ya! With these two navigation shortcuts (Go back / Go forward), you can do so. See what I mean now? Your debugging experience just became a little sweeter buddy! ? ? Anyways! This feature allows accessing any function or variable in the file you initially declared at. ⇧⌘O (MacOS) | Ctrl+Shift+O (Windows): The day I discovered this one and understood what " Go to Symbol." meant, the countless moments I should've used it starting flashing by. You are probably using this one ALL THE TIME. ⌘P (MacOS) | Ctrl+P (Windows): To open the command palette to open a file or activate a feature. Learning the basics of keyboard navigation will make your workflow way smoother. Happy reading, my friends! ??? Built-in Features #1. So today, let's browse the built-in features and extensions that I use every single day to optimize my codeflow. It also has great backup from the web development community to help you optimize your workflow while coding (your "code flow" ? * wink wink). I am a massive fan of VS Code for one simple reason: It includes Git and a debugger by default, and you can customize your environment with a myriad of extensions and themes.
? But so far, I've never mentioned how I optimize my productivity in my coding environment.
If you go through my previous articles, you'll quickly figure out that one of my common themes is how to increase your productivity while coding. These top tips and tricks will help you dramatically increase your productivity while coding in Visual Studio Code.