As 2019 begins, Stack Overflow’s 2018 IT Ecosystem survey shows that Visual Studio Code has leapfrog Visual Studio to the top of the list as the “most popular development environment” without a single one!


VScode is free, open source, lightweight, fast, powerful, and intelligent. Today, let’s learn eight efficient VScode development tips to make your development efficiency up and up!

1. Press CTRL +K and then CTRL +S to view the shortcut keys list.


If you want to see a shortcut for an action, you don’t have to look at the official documentation, just pull up the shortcut list and search for the action you want in the upper search bar to get the corresponding shortcut combination.

2. Press CTRL +P to pop up the search bar, enter the keyword directly, and search for specific symbols in all files:

Search within all files. employee" The keyword

Type “@” in the search bar to search for a specific symbol in the current file:

Search for the keyword “Employee” in the currently open file

Type “>” in the search bar to search for all available commands, such as commands I want to use the Spring Initializr extension to create a Maven project:

Search the “Spring Initializr: Generate a Maven Project” command

3. It’s common to switch between different files while reading code. You can download the Bookmarks plugin from the plugin market to help you mark and find pieces of code faster.


Use the second knowledge, CTRL +P, then enter “>”, enter the plug-in name, view the command of the plug-in:

Mark lines 36-38 in the figure

Select Toggle Labeled (tag and name the tag) and name it “getId”. When we are in another file, we can search the tag directly and jump to the tag ~

Select Bookmarks: List from All Files to display your tabs

See the code block we just marked ~Enter key directly jump ~

4. Right-click on a function or variable to view its definition and reference without moving the current code location.

Right click on Peek Definition
The property definition is displayed

Similarly, you can see where the function or variable is referenced: Select “Peek Reference”

See where the variable is referenced
Pop up the reference position of the variable

5. Zoom by CTRL += and CTRL +-.

When you think the current font is a little too small, hard to read, or a little too big, you don’t have to go around in the Settings menu bar, you just use the two key combinations above to zoom.

amplification
narrow

6. Use the Paste Json As Code extension to serialize the copied Json file directly into Code.


For example:

Add the following JSON file:

Json file

Serialized to Java code:


Directly open the command board, enter Paste Json As Code command, very convenient.

7. Use the 12 million installed Gitlens extension to help you better collaborate with code and see code change history.


With GitLens, when you clone code from Github, you will see the author of the code, and when the code is committed:

You can see that author Greg Turnquist made a commit to change the code three things ago

Click on the new “Toggle File Blame Annotation” button in the top right to show how your code differs from the original REPO:

Click on the change icon
See how your changes differ from the original version of the code

On the left side of the split line is the original REPO, and on the right side is our changed code, where we can see the specific code author and commit time.

In the action bar on the left, the GitLens icon appears. Click on it to view details about branch, Master, and Commit:


You can see the entire commit history of the current repo, as well as the author’s Github avatar, and click on a change history to see all the differences between that change and the code before it.

8. The Finale: Microsoft’s flagship revolutionary development extension: VS Live Share is an extension that allows you and your colleagues to collaborate on real time remote code development. You don’t need to clone the entire project, just connect to your open session, and you and your colleague can develop and modify a file.

Visual Studio Live Share enables you to collaboratively edit and debug with others in real time, regardless what
programming languages you’re using or app types you’re building. It allows you to instantly (and
securely) share your current project, and then as needed, share
debugging sessions.
terminal instances.
localhost web apps.
voice calls, and more! Developers that join your sessions recieve all of their editor context from your environment (e.g. language services, debugging), which ensures they can start productively collaborating immediately, without needing to clone any repos or install any SDKs.


VS Live Share lets you edit and debug code in real time with your collaborators, regardless of what language and application you’re working on. It lets you share your current projects in real time and securely, and if desired, even debug meetings, command line examples, local Web applications, voice calls, and more! Conference developers can receive all editing content (such as language services, debugging) from your environment, ensuring that attendees can collaborate effectively without having to clone project code and install development kits.


Easy to use, install the extension:


Enable the extension, reload your VScode, and see the Live Share icon in the lower left corner:


Jump to the browser page:


Log in using our GitHub account (or Microsoft account).

Then go back to our VS Live Share screen and you can see:

Real-time code Salon

It’s just me, so how do you get other people involved?

Click on the icon

For every live code conference that’s held, there’s a url, which is the URL, and if you click on this button, it’s automatically in your clipboard, and you just send the URL to your colleagues, and they go to the url in their browser:


Then click Open Live Share for VS Code, which automatically pops up. Your VS Code will start automatically. After you Open it, you have entered the Code Live Share, and you can start sharing the whole project with others. You can even use voice Call to communicate with them in real time and enjoy code development together.

If you like it, please give it a thumbs up

For more IT information and programming tutorials, please follow the author: Niu Dai.