Preface
As a front-end programmer, I often use
VSCode
code editors, but every developer has their own unique work style and preferences. In order to meet the needs of different developers,VSCode
a rich plug-in ecosystem is provided. In this article, I will recommend some powerfulVSCode
plug-ins that will help you create a personalized development environment and make your coding experience more comfortable and efficient.
How to install plugins
Install the plug-in by clicking on the image below or using the shortcut key ctrl+shift+x
to open the extension module.
1. chinese (Chinese compiler)
chinese
The plug-in is available for VS Code
the Chinese (Simplified) language pack. This Chinese (Simplified) language pack VS Code
provides a localized interface for .
2. vetur (necessary for vue development)
vetur
A plug-in is a dedicated development Vue.js
project. It provides many useful features, including syntax highlighting, code completion, error checking, formatting, debugging, and more. Vetur
It also supports Vue
editing and previewing of single-file components, making it easier for developers to write and debug Vue.js
applications. If you are Vue.js
a developer, I strongly recommend you to install and use Vetur
plug-ins to improve development efficiency.
3. Auto Close Tag (automatic closing tag)
Auto Close Tag
Plug-ins can automatically close tags HTML
, XML
and other similar markup languages. When you enter a start tag, it automatically inserts the corresponding end tag and positions the cursor between the two tags so you can continue writing content.
4. Beautify (formatting code)
Beautify
Plugins can help you format your code to make it more beautiful and readable. It supports a variety of programming languages, including JavaScript
, HTML
, , CSS
, JSON
etc. When you use Beautify
the plug-in, it will automatically adjust indentation, line breaks, spaces, etc. according to the preset code style rules to make the code structure clearer. Additionally, Beautify
there are some customization options available that can be configured according to personal preference.
注意:此扩展已弃用,因为已不再对其进行维护。
5. CSS Peek (quickly view styles)
CSS Peek
CSS
Plugins help you quickly view and navigate styles in the editor . When you HTML
select a CSS
class or class in the file ID
, CSS Peek
you can use the plug-in to easily jump to the corresponding CSS
style definition. It will display the relevant code in the editor's sidebar or pop-up window CSS
, allowing you to view and edit the style directly. This plug-in also provides some other functions, such as viewing CSS
the usage of selectors, finding related style definitions, etc.
6. Git History (git version control)
Git History
Plug-ins help you view and browse Git
version-controlled commit history. With Git History
the plugin, you can easily view the details of each commit, including author, commit time, commit message, and more. You can also compare file differences between different commits and view changes to files. In addition, Git History
some other functions are provided, such as viewing branches, switching commits, restoring files, etc. This plug-in is very useful for version control in team collaboration or personal development, and can help you better understand the evolution and history of the project.
7. GitLens (browse git related information)
GitLens
Git
Plug-ins can add many powerful features to your experience. Through the plug-in, you can view and browse version control-related information GitLens
directly in the editor . Git
It displays information such as the author, last modification time, and submission message next to each line of code, making it easier for you to understand the source and modification history of the code. In addition, GitLens
some other functions are provided, such as viewing Blame
comments on files, comparing differences between different commits, viewing branches and tags, etc. It also integrates some shortcut commands to help you perform operations more quickly Git
, such as submitting, pulling, pushing, etc.
8. Guides (code auxiliary lines)
Guides
Plugins are a built-in feature that helps you better align your code. In the editor, you can editor.guides
find relevant options by searching for in settings. It allows you to display vertical and horizontal guides in the editor to help you better align your code. You can customize these guides by choosing different colors and styles. This function is very useful for writing code with high alignment requirements, such as HTML
, CSS
, JavaScript
etc.
9. Image preview (real-time preview of images)
Image preview
The plug-in can preview image files in real time in the editor, allowing developers to view the content and effects of images while writing code.
10. HTML CSS Support (code assistance function)
HTML CSS Support
The plug-in provides intelligent code completion, syntax highlighting, code snippets and other auxiliary functions for HTML
and . This plugin helps developers write and code CSS
more efficiently .HTML
CSS
Some key features include:
- Code completion: When you enter
HTML
orCSS
code, the plug-in will provide intelligent code completion suggestions based on the context, including tags, attributes, selectors, attribute values, etc.; - Syntax highlighting: The plug-in will highlight
HTML
the and codes according to syntax rules to make the code more readable;CSS
- Code snippets: The plug-in provides some commonly used code snippets that can be quickly inserted with simple abbreviations. For example, entering
div.container
will automatically generate a tag withclass
for ;container
div
HTML
Quick documentation: You can view the documentation for the and properties by hovering over the code or using shortcut keysCSS
to get more information about the properties;Emmet
Support: The plug-in is integrated and can quickly generate and codesEmmet
through simple abbreviations .HTML
CSS
11. Import Cost (displays the size of the imported package)
Import Cost
The plug-in can help developers display the size of imported modules in real time in the code. This is very helpful for optimizing the performance and loading speed of front-end projects. When you import a module in your code, Import Cost
size information for the module is displayed next to the line of code, usually as a file size or as a gzip
compressed size. This way you can quickly understand the size of each module and better optimize your code. Import Cost
Supports multiple languages and module systems, including JavaScript
, , TypeScript
, React
, Vue
etc., and can be integrated with other plug-ins and tools, such as Webpack
, Rollup
etc.
12. JavaScript (ES6) code snippets (generate code snippets)
JavaScript (ES6) code snippets
The plug-in provides a series of JavaScript
code snippets for development, especially for ES6(ECMAScript 2015)
syntax. You can JavaScript
use shortcuts to quickly insert frequently used code templates while writing code. These code snippets cover a variety of common JavaScript
syntax and functionality, including variable declarations, function definitions, arrow functions, template strings, destructuring assignment , Promise
etc.async/await
13. One Dark Pro (dark theme)
One Dark Pro
The plugin provides a dark theme to help you have a better visual experience while writing code. It can VS Code
be selected as the editor's theme in the theme settings of . Once a theme is applied One Dark Pro
, the editor's background, text color, syntax highlighting, etc. will be adjusted accordingly according to the theme's design.
One Dark Pro
Features of the theme include:
- Dark background: The theme uses a dark background color to make the code more prominent and reduce eye fatigue;
- High Contrast: The theme uses bright text colors to contrast with dark backgrounds, making the code more readable;
- Syntax highlighting: The theme provides precise syntax highlighting for various programming languages to make the code structure clearer;
- Unified color scheme: The theme uses a consistent color scheme to make different syntax elements clearly visually distinguished.
14. Path Intellisense (path completion)
Path Intellisense
The plug-in provides path intelligence function to help you enter and complete file paths more easily. When you enter a file path in the editor, it automatically provides you with path suggestions and completions. This includes files and folders in the file system, as well as files that already exist in your project. Path Intellisense
It also provides some other functions, such as quick navigation of paths, copy and paste of paths, etc. It also supports a variety of file systems, including local file systems, network file systems, and remote file systems.
15. Open in Browser (open file)
Open in Browser
HTML
The plug-in allows you to right-click on files such as , CSS
, , etc. in the editor JavaScript
and open them through the default browser. You can VS Code
open a HTML
file in and right-click the file in the editor. In the right-click menu, you will see an Open in Default Browser
option. After selecting this option, the plug-in will automatically open the HTML file using your default browser and display its content in the browser.
16. Prettier - Code formatter (formatted code)
Prettier - Code formatter
It is a popular code formatting tool that can help you automatically format your code to conform to a unified coding style. It supports a variety of programming languages, including JavaScript
, TypeScript
, , CSS
, HTML
, JSON
etc. You can select the code file you want to format, and then use the shortcut key (default is Shift + Alt + F
) or the option in the right-click menu Format Document
to trigger formatting. The plug-in automatically formats the code and applies it to the file based on predefined rules and configurations. Of course, you can customize it according to your needs. You can specify formatting rules in a configuration file in the project (such as .prettierrc
) or VS Code
configure them globally in the settings of .
17. vscode-icons (file icon)
vscode-icons
Plugin that provides rich icons for files and folders to enhance editor visualization. vscode-icons
The plug-in provides a large number of icons, covering various common file types and extensions. These icons can help you identify and distinguish different types of files more quickly, and improve your navigation and search efficiency in the project. In addition, vscode-icons
custom icon rules are also supported. You can specify custom icons for specific file types or extensions based on your needs. This allows your project to be more personalized and aligned with your visual preferences. Currently, this plug-in is VS Code
supported internally: " File " -> " Preferences " -> " File Icon Theme ".
18. Indent-Rainbow (indent color prompt)
Indent-Rainbow
The plugin helps you more intuitively identify and understand the indentation structure of your code by applying different colors to each indentation level. When you open a file in the editor, Indent-Rainbow
indentation in the code is automatically detected and a different rainbow color is applied to each indentation level. This way, you can clearly see the indentation levels in the code, making it easier to understand the structure of the code. The plugin supports custom colors and indent size. You can configure it in the plug-in settings according to your preferences and needs.
19. filesize (display file size)
filesize
The plug-in can display the current file size in the status bar at the bottom, and you can also see the detailed creation and modification time after clicking it. The plug-in supports a variety of formatting options, such as specifying the number of decimal places, specifying units, specifying byte prefixes, etc. You can configure this in the plugin's settings.
20. Better Comments (code comments)
Better Comments
The plugin provides more powerful code commenting capabilities, allowing you to better organize and label your comments.
Using Better Comments
plugins, you can categorize and color comments by adding specific tags before them. These markers include:
!
: Used to highlight important notes or parts that require special attention;?
: Comments used to express questions or require further explanation;TODO
: Used to mark tasks or to-do items that need to be completed;*
: Used to emphasize or mark key information in comments;//
: used for ordinary comments.
By using these tags, you can distinguish different types of comments more clearly, and quickly locate and understand the content of the comments in the code. In addition, Better Comments
custom markings and colors are supported, which you can configure according to your preferences and needs.
21. CodeSnap (code generated pictures)
CodeSnap
Plugins can help you convert code snippets into beautiful code screenshots and support custom styles and themes. You can choose from different styles and themes, including code highlighting, background colors, font sizes, and more, to create beautiful screenshots that suit your needs. The plugin also supports customizing the size, file type and file name of your snippets, as well as adding metadata such as titles and descriptions.
22. Regex Previewer (real-time testing of regular rules)
Regex Previewer
Plug-ins help you preview matching results in real time while editing regular expressions. It displays a live preview pane in the editor's sidebar with a highlight of the matching results. The plug-in supports a variety of regular expression syntax, including JavaScript
, Python
, Java
and other common syntaxes. You can choose the syntax type that suits you according to your needs.