search
HomeDevelopment ToolsVSCodeOne trick to teach you to use the plug-in in vscode to replace the code of the entire project (favorite)

In the previous article "In-depth analysis of the production and use of css font icons (code sharing)", we learned about the production and use of css font icons. The following article will show you how to use the plug-in in vscode to replace the code of the entire project. Let's see how to do it together.

One trick to teach you to use the plug-in in vscode to replace the code of the entire project (favorite)

Use this vscode plug-in to replace the code of the entire project in minutes

One trick to teach you to use the plug-in in vscode to replace the code of the entire project (favorite)

Preface

Since the gogocode tool was open sourced, we have heard calls from community partners for the vscode plug-in, so we reused it The ability of playground is combined with the local file and directory structure to develop the vscode plug-in!

playground address https://play.gogocode.io/

vscode plug-in https://marketplace.visualstudio.com/items?itemName=mmfe .vscode-gogocode

My feeling after using it is: I should have listened to my friends earlier, it’s so delicious!

Now that the plug-in has taken shape, let me introduce how to use the GoGoCode plug-in to facilitate batch code conversion and modification.

Download and install

vscodePlug-in store searchgogocode

One trick to teach you to use the plug-in in vscode to replace the code of the entire project (favorite)

Try converting a single file

1. Right-click the file and "Convert with GoGoCode" to open the plug-in window

One trick to teach you to use the plug-in in vscode to replace the code of the entire project (favorite)

##2 . Write conversion code: I want to rewrite the introduction method of

component, and change the code in the form of (resolve) => require([xxx], resolve) to () => import(xxx)

If you have more complex processing scenarios, you can write conversion logic based on gogocode. Refer to the documentation. Currently, conversion of js, html, and vue is supported.

One trick to teach you to use the plug-in in vscode to replace the code of the entire project (favorite)

3. Replace the source file: The conversion effect is immediate. Click

replace, and the file will be modified successfully~

Batch convert files

gogocodeThe plug-in also supports replacement in the entire project or multiple selected files

One trick to teach you to use the plug-in in vscode to replace the code of the entire project (favorite) ##1. Select the folder: Right-click on the file directory, "Convert with

gogocode

"

If you want to block certain selected files or folders, you can ctrl-click multiple files Then remove in batches

2. Write the conversion code

3. Replace the original file:

replace

You can only replace the currently displayed file, replaceAllYou can replace all files in the directory tree

When replacingAll, only files that have been successfully converted will be replaced, and files that have been converted incorrectly will not be replaced

For this requirement , a friend in the exchange group contributed a regular rule:

One trick to teach you to use the plug-in in vscode to replace the code of the entire project (favorite)# It is really convenient to use regular rules for simple replacement, but there are many boundary conditions to consider, such as spaces, newlines, and special characters. wait. If it is more complicated and difficult to use regular expressions, you are welcome to use

gogocode

. Free one-click upgrade vue2 function

In addition to very convenient batch replacement, friends who install the

gogocode

plug-in can enjoy one-click upgrade to vue2 for free Code upgrade to vue3 rights! You only need to right-click the folder and select "

vue2

Upgrade to vue3". You don't need to type commands or copy and paste the path to convert the code with one click. For more information on vue upgrades, you can click here: Alimama has made a new tool to help you change the Vue2 code to the of Vue3

Official website address: https://gogocode.io/zh

Recommended learning:
vscode tutorial

The above is the detailed content of One trick to teach you to use the plug-in in vscode to replace the code of the entire project (favorite). For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:掘金. If there is any infringement, please contact admin@php.cn delete
Visual Studio Professional and Enterprise: Paid Versions and FeaturesVisual Studio Professional and Enterprise: Paid Versions and FeaturesMay 10, 2025 am 12:20 AM

The difference between VisualStudioProfessional and Enterprise is in the functionality and target user groups. The Professional version is suitable for professional developers and provides functions such as code analysis; the Enterprise version is for large teams and has added advanced tools such as test management.

Choosing Between Visual Studio and VS Code: The Right Tool for YouChoosing Between Visual Studio and VS Code: The Right Tool for YouMay 09, 2025 am 12:21 AM

VisualStudio is suitable for large projects, VSCode is suitable for projects of all sizes. 1. VisualStudio provides comprehensive IDE functions, supports multiple languages, integrated debugging and testing tools. 2.VSCode is a lightweight editor that supports multiple languages ​​through extension, has a simple interface and fast startup.

Visual Studio: A Powerful Tool for DevelopersVisual Studio: A Powerful Tool for DevelopersMay 08, 2025 am 12:19 AM

VisualStudio is a powerful IDE developed by Microsoft, supporting multiple programming languages ​​and platforms. Its core advantages include: 1. Intelligent code prompts and debugging functions, 2. Integrated development, debugging, testing and version control, 3. Extended functions through plug-ins, 4. Provide performance optimization and best practice tools to help developers improve efficiency and code quality.

Visual Studio vs. VS Code: Pricing, Licensing, and AvailabilityVisual Studio vs. VS Code: Pricing, Licensing, and AvailabilityMay 07, 2025 am 12:11 AM

The differences in pricing, licensing and availability of VisualStudio and VSCode are as follows: 1. Pricing: VSCode is completely free, while VisualStudio offers free community and paid enterprise versions. 2. License: VSCode uses a flexible MIT license, and the license of VisualStudio varies according to the version. 3. Usability: VSCode is supported across platforms, while VisualStudio performs best on Windows.

Visual Studio: From Code to ProductionVisual Studio: From Code to ProductionMay 06, 2025 am 12:10 AM

VisualStudio supports the entire process from code writing to production deployment. 1) Code writing: Provides intelligent code completion and reconstruction functions. 2) Debugging and testing: Integrate powerful debugging tools and unit testing framework. 3) Version control: seamlessly integrate with Git to simplify code management. 4) Deployment and Release: Supports multiple deployment options to simplify the application release process.

Visual Studio: A Look at the Licensing LandscapeVisual Studio: A Look at the Licensing LandscapeMay 05, 2025 am 12:17 AM

VisualStudio offers three license types: Community, Professional and Enterprise. The Community Edition is free, suitable for individual developers and small teams; the Professional Edition is annually subscribed, suitable for professional developers who need more functions; the Enterprise Edition is the highest price, suitable for large teams and enterprises. When selecting a license, project size, budget and teamwork needs should be considered.

The Ultimate Showdown: Visual Studio vs. VS CodeThe Ultimate Showdown: Visual Studio vs. VS CodeMay 04, 2025 am 12:01 AM

VisualStudio is suitable for large-scale project development, while VSCode is suitable for projects of all sizes. 1. VisualStudio provides comprehensive development tools, such as integrated debugger, version control and testing tools. 2.VSCode is known for its scalability, cross-platform and fast launch, and is suitable for fast editing and small project development.

Visual Studio vs. VS Code: Comparing the Two IDEsVisual Studio vs. VS Code: Comparing the Two IDEsMay 03, 2025 am 12:04 AM

VisualStudio is suitable for large projects and Windows development, while VSCode is suitable for cross-platform and small projects. 1. VisualStudio provides a full-featured IDE, supports .NET framework and powerful debugging tools. 2.VSCode is a lightweight editor that emphasizes flexibility and extensibility, and is suitable for various development scenarios.

See all articles

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 Article

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.