Table of Contents
Execute npm scripts with one click
Open a file in the sidebar
More powerful search
File diff displays directory information
Editor One-click preview of markdown
One-click diff in the editing area
Quick search function entrance
Editing shortcut keys
comand shift p Related
Summary
Home Development Tools VSCode These vscode tips you may not know can help you improve your development efficiency!

These vscode tips you may not know can help you improve your development efficiency!

Jul 19, 2021 am 10:09 AM
vscode

This article will share with you vscode tips that you may not know. It can make you write code more efficiently and help you improve development efficiency. Come and collect it!

These vscode tips you may not know can help you improve your development efficiency!

vscode is a commonly used editor when we write code. It has many functions, but in fact we don’t use many of them. This article just wants to sort it out. Here are some tips that you may not know but are very helpful in improving your efficiency. [Recommended learning: "vscode tutorial"]

Includes:

  • One-click execution of npm scripts
  • One-click diff and preview
  • Search in a new page
  • git view displays directory tree
  • Open a file in a new editor
  • Quickly delete, copy, and move lines while editing
  • Search files globally, jump to a certain line
  • Quickly switch case

Execute npm scripts with one click

Execute npm scripts Need to be on the command line? That's because you haven't used this function that comes with vscode.

These vscode tips you may not know can help you improve your development efficiency!

vscode will scan all npm scripts and list them. Just click run and the terminal will open to run. In addition, higher versions of vscode can also be run with debug directly.

There is no need to enter npm run xxx yourself.

Open a file in the sidebar

When you open a file, it will be opened in the current editor by default. What if you want to open a new editor? At this time, you can hold down option and click on the file, and a new editor will open to open the file.

These vscode tips you may not know can help you improve your development efficiency!

Because by default vscode opens a new file in the current editor, it is quite troublesome if you don’t know that you can open a new editor by holding down option and clicking.

More powerful search

Search There is a button in this panel that many students may not have noticed. After clicking it, the search page will open to search, and you can preview the search. The results are richer and have more rows.

These vscode tips you may not know can help you improve your development efficiency!

For example, if I search for @babel/core:

These vscode tips you may not know can help you improve your development efficiency!

Look, is it better than the small box on the left? Show more here.

These vscode tips you may not know can help you improve your development efficiency!

You can see by comparison that the search results on the right are clearer because multiple lines will be displayed.

File diff displays directory information

When we change multiple files, they will be listed in the list of the source control panel. When there are multiple files with the same name Particularly unintuitive.

These vscode tips you may not know can help you improve your development efficiency!

At this time, you can actually switch to tree view to display the directory tree.

These vscode tips you may not know can help you improve your development efficiency!

When there are multiple files with the same name, this will be much clearer:

These vscode tips you may not know can help you improve your development efficiency!

Editor One-click preview of markdown

markdown Do I need to install a plug-in? No, vscode itself has this feature built in.

These vscode tips you may not know can help you improve your development efficiency!

#There is a preview button in the upper right corner. Clicking it will open the markdown preview interface. Press and hold option and click again to open the preview in the same window.

After previewing, click the show source button and you will go back

These vscode tips you may not know can help you improve your development efficiency!

One-click diff in the editing area

Quickly switch between diff and file editing views

When you change the file content, you can click the button in the upper right corner of the editing area to open the diff directly. Many students may not notice it. These buttons are actually very useful.

1These vscode tips you may not know can help you improve your development efficiency!

Click again to return to the file editing state

1These vscode tips you may not know can help you improve your development efficiency!

Look at the function description open changes and open files, it is obvious It is used to switch between diff view and file editing view.

diff view quickly jumps between diffs

When the file content is particularly large, such as thousands of lines, it is still troublesome to find the diff. of. In fact, you don’t have to look for it yourself, and it’s easy to miss it. The vscode editor provides up and down buttons, which can jump directly to the previous diff and next diff

1These vscode tips you may not know can help you improve your development efficiency!

One-click preview, one-click preview, and one-click preview. Key diff, these are all functions that can improve efficiency.

Quick search function entrance

Know that vscode has a certain function but don’t know where the entrance is? Just use the search box under help, and the search results will directly indicate what buttons are under which menu.

1These vscode tips you may not know can help you improve your development efficiency!

Editing shortcut keys

The main function of the editor is editing, but in fact there are many vscodes. Please use the editing function. Maybe I haven’t, so let me list them.

Move rows up and down/copy

What should I do if I move the content of a row up or down?

1These vscode tips you may not know can help you improve your development efficiency!

#The efficiency of manual cutting and pasting is too low. It is better to try the option up/down shortcut keys to quickly move a line of content up and down.

Want to copy when moving? Just hold shift again.

1These vscode tips you may not know can help you improve your development efficiency!

Quickly delete rows

We know how to quickly copy rows, but what about quickly deleting rows?

Just press command shift k.

If you want to delete multiple lines, select them first and then press command shift k.

Multi-cursor editing at the same time

Modify the content in multiple places at the same time? Just hold down option and click on the place you want to modify.

1These vscode tips you may not know can help you improve your development efficiency!

What if it’s the same location for uplink and downlink? Then use the option command up/down, so that the cursor at the same position is added to multiple lines.

1These vscode tips you may not know can help you improve your development efficiency!

This may be a shortcut key that everyone knows. There will be a > in the input box. Following the representatives are commands, but there are some others that you may not know.

1These vscode tips you may not know can help you improve your development efficiency!

#For example, command p directly without pressing shift. At this time, the file is searched.

These vscode tips you may not know can help you improve your development efficiency!

For example, press ctrl g directly, or enter a colon in the input box, which means that the next line number is the jump line number, and you can quickly jump to a certain line

2These vscode tips you may not know can help you improve your development efficiency!

Of course, you can also add a colon and line number when searching for a file to quickly jump to that line of the file.

2These vscode tips you may not know can help you improve your development efficiency!

Quickly switch case

There is also a small function, with built-in uppercase and lowercase The switching function can quickly switch the uppercase and lowercase of the selected content.

2These vscode tips you may not know can help you improve your development efficiency!

2These vscode tips you may not know can help you improve your development efficiency!

Summary

This article has sorted out some functions in vscode that can improve efficiency. You may not have noticed it.

  • One-click diff and preview
  • Search on the new page
  • Git view displays the directory tree
  • One-click execution of npm scripts
  • Open the file in a new editor
  • Quickly delete, copy, and move lines while editing
  • Search files globally and jump to a certain line
  • Quickly switch case

Being familiar with the use of these functions, I believe it will improve the efficiency of our daily development. It is quite meaningful to learn the skills of using tools for writing code every day.

For more programming related knowledge, please visit: Programming Video! !

The above is the detailed content of These vscode tips you may not know can help you improve your development efficiency!. 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)

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.

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 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.

How to switch Chinese mode with vscode How to switch Chinese mode with vscode Apr 15, 2025 pm 11:39 PM

VS Code To switch Chinese mode: Open the settings interface (Windows/Linux: Ctrl, macOS: Cmd,) Search for "Editor: Language" settings Select "Chinese" in the drop-down menu Save settings and restart VS Code

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 set vscode in Chinese How to set vscode in Chinese Apr 15, 2025 pm 09:27 PM

There are two ways to set up a Chinese language in Visual Studio Code: 1. Install the Chinese language package; 2. Modify the "locale" settings in the configuration file. Make sure Visual Studio Code version is 1.17 or higher.

How to set vscode How to set vscode Apr 15, 2025 pm 10:45 PM

To enable and set VSCode, follow these steps: Install and start VSCode. Custom preferences including themes, fonts, spaces, and code formatting. Install extensions to enhance features such as plugins, themes, and tools. Create a project or open an existing project. Use IntelliSense to get code prompts and completions. Debug the code to step through the code, set breakpoints, and check variables. Connect the version control system to manage changes and commit code.

How to use VSCode How to use VSCode Apr 15, 2025 pm 11:21 PM

Visual Studio Code (VSCode) is a cross-platform, open source and free code editor developed by Microsoft. It is known for its lightweight, scalability and support for a wide range of programming languages. To install VSCode, please visit the official website to download and run the installer. When using VSCode, you can create new projects, edit code, debug code, navigate projects, expand VSCode, and manage settings. VSCode is available for Windows, macOS, and Linux, supports multiple programming languages ​​and provides various extensions through Marketplace. Its advantages include lightweight, scalability, extensive language support, rich features and version

See all articles