Installation and use of VS Code under Ubuntu

Only as a study note for learning punctual atomic Linux embedded development

VS Code (full name: Visual Studio Code) is a free cross-platform source code editor developed by Microsoft. I won't go into details about it, just go straight to the text.

VS Code download

Go to the VS Code official website https://code.visualstudio.com/ to download,

insert image description here

VS Code installation

Copy the downloaded installation package to the virtual machine (Ubuntu),

insert image description here

There are two installation methods, GUI installation and command line installation:

  1. GUI installation

insert image description here

  1. command line installation

insert image description here

Set up fast startup

After the installation is complete, you can codestart VS Code directly at the command line. If you find it troublesome, we can add it to the desktop shortcut or lock it to the launcher.

  1. Add desktop shortcut

Enter /usr/share/applications/, copy Visual Studio Code to the desktop
insert image description here

At this point, we can open VS Code on the desktop,

insert image description here

  1. Lock VS Code to Ubuntu Launcher

There is a launcher on the left side of Ubuntu (I moved it to the end), which is similar to the taskbar under Windows. Generally, after the software is opened, it will be displayed on the launcher. If we lock it, the software will become convenient.

However, the VS Code opened through the desktop shortcut created above will not be displayed on the launcher. At this time, we need to open VS Code with the command line terminal first, and then we will see the VS Code icon on the launcher.

insert image description here

Then we lock it to the launcher.

insert image description here

Install plugins for VS Code

VS Code supports multiple languages ​​and comes with many external extension packages, but these all need to be installed manually. The following is how to install the plugin:

insert image description here

The following are the plugins recommended in the Punctuality Atomic Tutorial:

insert image description here

After installation, you can check which plugins you have installed,

insert image description here

VS Code is easy to use

First select an empty folder as the project directory,

insert image description here

Create a new file,

insert image description here

save the file, rename it at the same time,

insert image description here

Write a simple C program,

insert image description here

Try compiling directly with VS Code, select the compiler, the
insert image description here
compilation is complete, it runs successfully, and the running result is displayed on the terminal.

insert image description here

We can also compile directly with commands in the terminal, first create a new terminal,

insert image description here
There is no difference between the terminal of the operation and the system, and there is a list of created terminals on the right side.

insert image description here

If you want to save this project so that it can be reopened in another location, you can click "Save Project Area As",

insert image description here

Give the project (workspace) a name,

insert image description here

In the file manager, you can open the VS Code project directly through this workspace file,
insert image description here

Guess you like

Origin blog.csdn.net/weixin_43772810/article/details/123624894