VS Code equivalent to Visual Studio’s Ctrl+m Ctrl+o

Sometimes, when you have a long file, it’s convenient to fold/collapse all the code regions so you can get a big picture of your file. In Visual Studio (the full blown IDE from Microsoft), it’s a simple keyboard shortcut combination

Ctrl+m Ctrl+o

Thankfully, Visual Studio Code has something similar. To fold ALL regions use

Ctrl+k Ctrl+0

Then just use the following to unfold the code file

Ctrl+k Ctrl+j

The nice thing about this is that all the sub regions are folded as well. So you can simply open one region and all the items inside are still folded.

Reference: https://code.visualstudio.com/docs/getstarted/tips-and-tricks#_keyboard-reference-sheets

Copy Multiple Items in Visual Studio 2019

As a developer, I have to copy and paste. A lot! Sometimes I need to copy several items from different locations and then paste them into the same file. This can be very tedious with the traditional Ctrl+C then Ctrl+V process. To help remedy this, I use Comfort Clipboard Pro, a very powerful clipboard manager. I realize for some this may be a bit of overkill or they don’t wish to spend the money on a solution.

Thankfully, Visual Studio 2019 has a feature which can help. Simply copy several items in a row using your preferred method — from the file menu or with a key command. Then place your cursor where you wish for the copied items to be pasted. Next, go to Edit in the file menu and select the Show Clipboard History option (alternately you can press Ctrl+Shift+Insert).

Select Show Clipboard History

This will display a popup list of the things you’ve just copied. Click one of the items in the list.

Displays list of clipboard items

The item you selected will be pasted into your file where your cursor currently sits.

Pasted item from clipboard

That’s it! Quick. Simple. It didn’t require any additional software. And it didn’t cost you anything. Hope that helps!

Copy Visual Studio 2017 configuration settings to Visual Studio 2019

Visual Studio 2019
Visual Studio 2019

Visual Studio 2019 shipped on April 1st. And one of the nice things about it is you can have it installed side-by-side with other version — like Visual Studio 2017. Most developers have spent some time selecting which features of Visual Studio they need installed. A nice addition to the new Visual Studio Installer is you can export your configurations from one version and import into another. So, if you’ve just installed 2019 and wish for it to be configured like your 2017 version, now you can! And it’s pretty straight forward.

Launch the Visual Studio Installer.

Click the Modify button next to your Visual Studio 2017 installation.
This will show you the current configuration. You can just close this modal if you don’t wish to make any changes.
Click the More drop down and then select Export configuration from your 2017 installation.
Choose a location on your system where you wish to save the configuration file.
You will then see all the current settings and give you one last change to make changes. Then click the Export button.
A confirmation message will display when exporting is successful.
Next, click the More drop down for your 2019 installation then click Import configuration.
Locate your configuration file you just exported.
It will display the configuration options which will be imported giving you a chance to make any changes. Then click the Modify button to make any changes to your 2019 installation.

And that’s it! The installer will download and install any needed components based on your older configuration file.