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
How to change vscode fontsHow to change vscode fontsApr 15, 2025 pm 05:00 PM

Customizing fonts in VS Code can improve the coding experience. Selecting the right font, such as Consolas, Fira Code, or Source Code Pro, can improve readability. Setting the font includes modifying the font name, size, and line height. Avoid common pitfalls such as font rendering issues, special character displays, and font conflicts. Advanced tips include using code snippets and choosing a coordinated topic to further enhance readability and aesthetics. By customizing fonts, you can create a comfortable and efficient coding environment.

How to check the vscode versionHow to check the vscode versionApr 15, 2025 pm 04:57 PM

You can determine your VS Code version number in the following ways: "About" menu: In the menu bar, select "Help" > "About", and the version number will be displayed in the pop-up window. Command panel: Press Ctrl Shift P (Windows/Linux) or Cmd Shift P (macOS), enter "about" or "version" to select the option to display version information. package.json file: Locate the package.json file in the installation directory of VS Code, which contains version information.

How to connect vscode to githubHow to connect vscode to githubApr 15, 2025 pm 04:54 PM

Through the official GitHub extension or git command line tool, VS Code can be connected to GitHub. Through this connection, users can view repositories, Pull Requests, and Issues in the VS Code sidebar, and conduct code reviews and submissions directly in the editor. Although the command line tools provide more granular control, the learning curve is steeper for beginners. Frequently asked questions include authentication failures and code conflicts that can be resolved by checking the token or manually resolving the conflict. Best practices recommend using .gitignore files, writing clear submissions, backing up code regularly, making good use of branches and learning Git workflows. VS Code and GitHub combine to provide powerful extensions

How to create a vscode extensionHow to create a vscode extensionApr 15, 2025 pm 04:51 PM

How to create a VS Code extension? Getting started: Preparation master JavaScript/TypeScript and VS Code extension API Creation "Hello World" extension basic architecture preparation package.json manifest file implements extension functions in src/extension.ts Advanced: Function extension creation custom language support (LSP knowledge is required) Use built-in debugger to debug extension code actual cases Automatic code formatting extension Quickly generate code snippet extensions Advantages and disadvantages Analysis Advantages: Strong ecosystem, easy-to-use API Disadvantages: Programming skills are required, debugging is possible

How to clear vscode cacheHow to clear vscode cacheApr 15, 2025 pm 04:48 PM

How to clean the VS Code cache to improve the development experience: Clean the extension cache: Close VS Code and delete the extension directory (Linux/macOS: ~/.vscode/extensions; Windows: %APPDATA%\Code\User\extensions) Clean the workspace cache: Delete the .vscode directory in the root directory of the project to clean other temporary files: Delete the system temporary file directory according to the operating system (Windows: %temp%; macOS: /tmp; Linux: /tmp)

How to comment out multiple lines with vscodeHow to comment out multiple lines with vscodeApr 15, 2025 pm 04:45 PM

VS Code's multi-line annotation feature provides powerful annotation efficiency. The basic annotation uses the shortcut keys Ctrl/ or Cmd/, and the block annotation uses the shortcut keys Shift Alt A or Shift Option A. These tips are suitable for large segments of code and provide best practice guidance on nested annotation processing and style consistency. In addition, VS Code also provides other auxiliary functions, such as automatic code completion and formatting, to further improve development efficiency.

How to clear the vscode terminalHow to clear the vscode terminalApr 15, 2025 pm 04:42 PM

Tips for efficiently managing VS Code terminals: Clear the terminal: Use Ctrl Shift K (Windows/Linux) or Cmd K (macOS) to clear the terminal content. Partial clear: Use terminal commands, such as clear in bash, to clear the screen content and keep the history. Multi-terminal: Create multiple terminals for different tasks to improve efficiency. Avoid path problems: Make sure the terminal path is correct, you can use the pwd and cd commands to view and switch directories. Solve permissions: Check whether there are permission restrictions, and run the command using sudo (Linux/macOS) or administrator rights. Check environment variables: Ensure environment variable configuration

Visual Studio vs. VS Code: Exploring Features and FunctionalityVisual Studio vs. VS Code: Exploring Features and FunctionalityApr 15, 2025 am 12:05 AM

VisualStudio is suitable for large projects and full-featured needs, while VSCode is suitable for developments that require lightweight and flexibility. 1. VisualStudio provides comprehensive IDE functions, supports multiple languages ​​and advanced project management. 2.VSCode is known for its lightweight and scalability, and is suitable for cross-platform development and personalized configuration.

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version