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

How to use vscode

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

Editor to share with you how to use vscode, I hope you will gain something after reading this article. Let's discuss it together.

Environment: mac system

Command panel

The command panel is the main interface for vscode shortcuts and can be opened using F1 or Cmd+Shift+P (win Ctrl+Shift+P). In the command panel, you can enter a command to search (both Chinese and English), and then execute it.

Various commands can be executed in the naming panel, including the functions provided by the editor and the functions provided by the plug-in. So be sure to remember its shortcut key Cmd+Shift+P

Use vscode on the command line

If you are a Windows user, after installing and restarting the system, you can use code or code-insiders on the command line. If you want to use it immediately rather than waiting for reboot, you can add the installation directory of VS Code to the system environment variable PATH.

If you are a mac user, open the named panel Cmd+Shift+P after installation, search for the shell command, click the install code command in PAth, and then restart the terminal on ok.

3. Movement of the cursor

Move to the beginning of the line Cmd+ left arrow key (win Home)

Move to the end of the line Cmd+ right arrow key (win End)

Move to the beginning and end of the document Cmd+ up and down arrow keys (win Ctrl+Home/End)

Jump Cmd+Shift+ (win Ctrl+Shift+) between the left and right side of curly braces {}

IV. Text selection

You only need to press one more shift key to select the Chinese text as the cursor moves.

Select the word Cmd+D to talk about under the multi-cursor will also talk about Cmd+D

There are no shortcuts for the selection of code blocks, you can use cmd+shift+p to open the command panel, enter all the contents of the selection parentheses, and talk about how to add shortcuts later

5. Code movement

Option+ up and down arrow keys (win Alt+ up and down)

You can copy the code up and down the Option+Shift+ by holding down shift while the code moves.

VI. Code formatting

Format the entire document: Option+Shift+F (win Alt+Shift+F). Vscode will use different plug-ins according to the language you use. Remember to download the appropriate formatted plug-ins.

Format the selected code: Cmd+K Cmk+F win (Ctrl+K Ctrl+F)

Code indentation

To adjust the indentation of the real document, use Cmd+Shift+P to open the command panel, enter indentation, and then select the appropriate command

Select code indentation adjustment: Cmd+] Cmd+ [is to decrease and increase indentation, respectively.

8. Open files quickly

Cmd+P (win Ctrl+P) enter the name of the file you want to open and enter to open it.

IX. Code refactoring

When we want to change the name of a function or variable, we just place the cursor over the name of the function or variable and press F2 so that the function or variable will be modified where it appears.

After reading this article, I believe you have a certain understanding of "how to use vscode". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

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