Home Development Tools VSCode [Compilation and Sharing] Commonly used and efficient tips in VSCode (wonderful skills and tricks)

[Compilation and Sharing] Commonly used and efficient tips in VSCode (wonderful skills and tricks)

Aug 15, 2022 pm 07:32 PM
vscode

VSCodeHow to use? What are some weird tricks? In order to give everyone a clearer understanding of VSCode, this article will share with you some of its efficient uses (weird tricks). I hope it will be helpful to you!

[Compilation and Sharing] Commonly used and efficient tips in VSCode (wonderful skills and tricks)

Different development tools can capture their own group of loyal users and supporters.

VS Code, Eclipse, IDEA, atom... which development tool is better? There has always been such a debate.

VS Code has become a popular development tool in recent years and has gradually been welcomed by more developers.

The reason why it is so popular is inseparable from its continuous innovation and breakthroughs.

Even so, many users still find VS Code difficult to use.

This is not difficult to understand. If a student who has used tool A suddenly migrates to tool B, even if it is already perfect, he can still find a lot of faulty points.

One of the reasons is due to usage habits, and the other is that developers don’t know enough about this new tool.

But one thing should be clear. As a popular development tool at the moment, VS Code also supports many excellent functions that other development tools have.

In order to let everyone understand VS Code more clearly, today I will introduce to you some of its efficient usage. [Recommended learning: "vscode introductory tutorial"]

Integrated terminal


In VS Code, Able to open the terminal directly. This eliminates the need to switch windows and avoid wasting time whether you are debugging code or executing terminal command line tools.

To use the VS Code terminal, you need to install it first. The installation steps are very simple and only require the following steps:

  • Start VS Code
  • shift cmd pOpen the command panel and enter shell command
  • Click to confirm

In this way, the development of the VS Code integrated terminal is completed.

Batch renaming


[Compilation and Sharing] Commonly used and efficient tips in VSCode (wonderful skills and tricks)

##Names play a vital role in the development process status. Function names, class names, variable names... In the process of writing code, we often deal with various names.

Renaming will be often used at this time. If a variable name appears

100 times in the code, it will obviously be very troublesome to manually modify it one by one.

Use the shortcut key

shift cmd l to select all the names that appear in the code and rename them in batches.

Based on the fact that it takes 5 seconds to rename once, this operation can take about 8 minutes.

Multiple selection mode


Multi-line editing is supported in many development tools because it has many application scenarios , and very efficient.


If there are multiple similar lines, this function is very practical. It can modify the content of multiple lines and multiple locations at the same time to avoid duplication of work.

[Compilation and Sharing] Commonly used and efficient tips in VSCode (wonderful skills and tricks)

alt click Each click will add a new cursor.

alt cmd down or alt cmd up will insert the cursor below or above respectively.

Command Panel


The Command Panel for VS Code makes VS Code fully accessible with just the keyboard.


Typing

shift cmd P will bring up the command panel, giving you access to all the features of VS Code.

Here are shortcuts for some of the most useful commands:

  • cmd P will allow you to navigate to any file or symbol by entering its name Symbol
  • ctrl tab will take you to the last set of files opened
  • shift cmd P will take you directly to the editor command
  • shift cmd O will allow you to navigate to a specific symbol in the file
  • ctrl g will allow you to navigate to a specific line in the file

Shortcut keys


Shortcut keys often put a burden on the user’s memory, but if they are used frequently, integrate them into For your own habits, the next step is to improve efficiency.


Next, let’s introduce some useful shortcut keys for VS Code. You don’t need to remember them all, just remember some that fit your usage scenario.

Navigation shortcut keys

  • shift cmd F Search
  • shift ctrl G Source code management
  • cmd shift D Run panel
  • cmd shift Properties
  • cmd j Use the terminal, question, output, debug console to switch the bottom panel that opens
  • Common shortcut keys
  • alt Z
  • Toggle automatic line wrapping. If the lines in the file are long and you need to see everything without formatting each line.

cmd F Search the current file

  • alt shift left/alt shift right
  • Select by word
  • cmd D
  • Find and select the next occurrence of the currently selected word.
  • cmd down/cmd up
  • Move the cursor to the end/beginning of the current file
  • cmd left
  • /
  • cmd rightMove the cursor to the end of the current linealt left
  • /
  • alt rightMove the cursor word by word ctrl -
  • /
  • ctrl shift - Back and forwardshift ctrl cmd left
  • /
  • shift ctrl cmd rightExpand or shrink block selection F12
  • /
  • cmd clickJump to definition
  • Editing shortcut key
  • cmd ##/
  • shift up
Move selection up and down

alt down

/
    alt up
  • Move up and down one line
  • shift alt down
  • /shift alt upCopy the row or selection and paste below or above the row or selection
  • Conclusion
  • If you remember these efficient ways to use VS Code, you will find that it is much more efficient than the operations you were accustomed to before.
  • No one can reach a thousand miles without taking small steps. Perhaps for a small amount of operations, the changes it brings cannot be felt. However, if in the development process of a large project, the changes brought by a tool The impact will be highlighted.
  • Through these efficient operations, VS Code allows you to focus on the coding itself without being affected by tool-level obstacles that affect development efficiency. The above is all the content shared this time. If you think the article is not bad, welcome to follow the official account: Python Programming Learning Circle
  • , share daily useful information, and you can get it by sending "J" A large number of learning materials, covering Python e-books, tutorials, database programming, Django, crawlers, cloud computing, etc. Or go to the Programming Learning Network to learn more about programming technology.

For more knowledge about VSCode, please visit: vscode tutorial!

The above is the detailed content of [Compilation and Sharing] Commonly used and efficient tips in VSCode (wonderful skills and tricks). For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1660
14
PHP Tutorial
1261
29
C# Tutorial
1234
24
What computer configuration is required for vscode What computer configuration is required for vscode Apr 15, 2025 pm 09:48 PM

VS Code system requirements: Operating system: Windows 10 and above, macOS 10.12 and above, Linux distribution processor: minimum 1.6 GHz, recommended 2.0 GHz and above memory: minimum 512 MB, recommended 4 GB and above storage space: minimum 250 MB, recommended 1 GB and above other requirements: stable network connection, Xorg/Wayland (Linux)

How to define header files for vscode How to define header files for vscode Apr 15, 2025 pm 09:09 PM

How to define header files using Visual Studio Code? Create a header file and declare symbols in the header file using the .h or .hpp suffix name (such as classes, functions, variables) Compile the program using the #include directive to include the header file in the source file. The header file will be included and the declared symbols are available.

vscode terminal usage tutorial vscode terminal usage tutorial Apr 15, 2025 pm 10:09 PM

vscode built-in terminal is a development tool that allows running commands and scripts within the editor to simplify the development process. How to use vscode terminal: Open the terminal with the shortcut key (Ctrl/Cmd). Enter a command or run the script. Use hotkeys (such as Ctrl L to clear the terminal). Change the working directory (such as the cd command). Advanced features include debug mode, automatic code snippet completion, and interactive command history.

Where to write code in vscode Where to write code in vscode Apr 15, 2025 pm 09:54 PM

Writing code in Visual Studio Code (VSCode) is simple and easy to use. Just install VSCode, create a project, select a language, create a file, write code, save and run it. The advantages of VSCode include cross-platform, free and open source, powerful features, rich extensions, and lightweight and fast.

Common commands for vscode terminal Common commands for vscode terminal Apr 15, 2025 pm 10:06 PM

Common commands for VS Code terminals include: Clear the terminal screen (clear), list the current directory file (ls), change the current working directory (cd), print the current working directory path (pwd), create a new directory (mkdir), delete empty directory (rmdir), create a new file (touch) delete a file or directory (rm), copy a file or directory (cp), move or rename a file or directory (mv) display file content (cat) view file content and scroll (less) view file content only scroll down (more) display the first few lines of the file (head)

How to solve the problem of vscode Chinese annotations becoming question marks How to solve the problem of vscode Chinese annotations becoming question marks Apr 15, 2025 pm 11:36 PM

How to solve the problem that Chinese comments in Visual Studio Code become question marks: Check the file encoding and make sure it is "UTF-8 without BOM". Change the font to a font that supports Chinese characters, such as "Song Style" or "Microsoft Yahei". Reinstall the font. Enable Unicode support. Upgrade VSCode, restart the computer, and recreate the source file.

vscode terminal command cannot be used vscode terminal command cannot be used Apr 15, 2025 pm 10:03 PM

Causes and solutions for the VS Code terminal commands not available: The necessary tools are not installed (Windows: WSL; macOS: Xcode command line tools) Path configuration is wrong (add executable files to PATH environment variables) Permission issues (run VS Code as administrator) Firewall or proxy restrictions (check settings, unrestrictions) Terminal settings are incorrect (enable use of external terminals) VS Code installation is corrupt (reinstall or update) Terminal configuration is incompatible (try different terminal types or commands) Specific environment variables are missing (set necessary environment variables)

vscode Previous Next Shortcut Key vscode Previous Next Shortcut Key Apr 15, 2025 pm 10:51 PM

VS Code One-step/Next step shortcut key usage: One-step (backward): Windows/Linux: Ctrl ←; macOS: Cmd ←Next step (forward): Windows/Linux: Ctrl →; macOS: Cmd →

See all articles