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)

青灯夜游
Release: 2022-09-30 18:16:48
forward
3032 people have browsed it

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!

Related labels:
source:segmentfault.com
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template