Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the skills of using VSCode

2025-02-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "what are the skills of using VSCode". Friends who are interested may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what are the skills for using VSCode?"

1. View the log

Step 1. Execute Ctrl+Shift+P

Step 2. Search showlogs

two。 Open VSCode's configuration file settings.json

Step 1. Execute Ctrl+Shift+P

Step 2. Search Open Settings (JSON)

3. View the log when connecting to the remote end

Add the following parameters to the configuration file settings.json of VSCode

"remote.SSH.showLoginTerminal": true,4. VSCode background is configured as bean paste green

Add the following parameters to the configuration file settings.json of VSCode

"workbench.colorTheme": "Atom One Light", "workbench.colorCustomizations": {"[Atom One Light]": {"editor.background": "# C7EDCC", "sideBar.background": "# e7f0e7", "activityBar.background": "# C7EDCC",},}, 5 Set the plug-ins installed by default at the remote end

Add the remote.SSH.defaultExtensions parameter to the VSCode configuration file settings.json, such as automatically installing the Python and Maven plug-ins, which can be configured as follows.

"remote.SSH.defaultExtensions": ["ms-python.python", "vscjava.vscode-maven"], 6. Install the specified local plug-in to the remote or remote plug-in locally

Step 1. Execute Ctrl+Shift+P

Step 2. Search install local and select as needed.

7. The remote end uses the Git repository 7.1 native Host configuration, this article takes the Windows10 system as an example

Step 1. Install OpenSSH

Step 2. Start PowerShell as an administrator and execute the following command as needed:

Start the SSHD service:

Get-WindowsCapability-Online |? Name-like 'OpenSSH*' Start-Service sshd Set-Service-Name sshd-StartupType' Automatic' Get-NetFirewallRule-Name sshNew-NetFirewallRule-Name sshd-DisplayName 'OpenSSH Server (sshd)'-Enabled True-Direction Inbound-Protocol TCP-Action Allow-LocalPort 22

Allow Windows to run SSH Agent automatically:

Set-Service ssh-agent-StartupType Automatic Start-Service ssh-agent Get-Service ssh-agent

Add the private key pair to the running agent:

Ssh-add.exe.\ id_rsa # path is the location of the private key to be added ssh-add.exe-L

Step 3. Edit the local sshconfig (such as ~\ .ssh\ config) file and add the configuration ForwardAgentyes, as shown below.

Host my_host HostName x.x.x.x Port x User x IdentityFile xx ForwardAgent yes

If ForwardAgentyes is added to all Host by default, the configuration can be added as follows:

Host * ForwardAgent yes7.2 remote flexible use of Git repository

For a brief video of Git operation instructions, please refer to the VSCode video tutorial (3: 54):

Code.visualstudio.com/docs/introv...

For more details on the use of Git functions, please read the official VSCode documentation code.visualstudio.com/docs/editor.

8. Install plug-ins remotely based on offline packages

Step one. Search for the A plug-in to be installed on the VSCode plug-in official website vscode_marketplace

Step two. Click to enter the details of plug-in A, and download the offline installation package for the plug-in.

Step three. Drag the downloaded .vsix file to the remote container

Step four. Right-click on the file and select Install ExtensionVSIX

9. After the remote restart, you need to delete the local known_hosts to connect.

You can configure the container parameters "StrictHostKeyChecking no" and "UserKnownHostsFile=/dev/null" in the local sshconfig file, as shown in the following reference:

Host my_host HostName x.x.x.x Port x User x IdentityFile xx ForwardAgent yes StrictHostKeyChecking no UserKnownHostsFile=/dev/null

Tip: adding the above configuration parameters will ignore the known_hosts file when logging in to SSH, which is a security risk.

10. You cannot enter the source code when debugging

If you already have a launch.json file, please look directly at step 3. Step 1: open the launch.json file. You can open it in any of the following ways:

Method 1: click the Run (Ctrl+Shift+D) button in the left menu bar, and then click create a launch.json file.

Method 2: click the Run > Open configurations button in the menu bar above

Step 2: select a language

If you need to set up the Python language, select Python File in the pop-up Select a debug configuration, and other languages will do the same.

Step 3: edit launch.json and add justMyCode ": false configuration, as shown in the following figure:

{/ / Use IntelliSense to learn about possible attributes. / / Hover to view descriptions of existing attributes. / / For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [{"name": "Python: current file", "type": "python", "request": "launch", "program": "${file}" "console": "integratedTerminal", "justMyCode": false}] 11. A pop-up dialog box prompts the user name and the user's mailbox configuration error when submitting the code

In terminal, execute the following command, and then try to submit again:

Change git config-- global user.email my_email # to your user's email git config-- global user.name my_name # to your user name 12. Disable automatic upgrade of VSCode version

Step 1. Execute Ctrl+Shift+P

Step 2. Search Open Settings (JSON)

Step 3. Add the following parameter "update.mode" to the configuration file settings.json: "manual"

13. Disable automatic upgrade of plug-in versions of VSCode

Step 1. Execute Ctrl+Shift+P

Step 2. Search Open Settings (JSON)

Step 3. Add the following parameter "extensions.autoUpdate" to the configuration file settings.json: fals

At this point, I believe you have a deeper understanding of "what are the skills for the use of VSCode?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report