


One 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.
Use this vscode
plug-in to replace the code of the entire project in minutes
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
vscode
Plug-in store searchgogocode
Try converting a single file
1. Right-click the file and "Convert with GoGoCode
" to open the plug-in window
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.
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
##1. Select the folder: Right-click on the file directory, "Convert with
"
2. Write the conversion code
3. Replace the original file:
replaceYou can only replace the currently displayed file, replaceAll
You can replace all files in the directory tree
For this requirement , a friend in the exchange group contributed a regular rule:
# 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
. 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 "
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
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!

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.

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.

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

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.

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

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.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

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
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

SublimeText3 Linux new version
SublimeText3 Linux latest version