Code for automatic indentation, formatting, copying, and pasting of vscode

Source: Internet
Author: User

When we copy and paste a piece of code, VSC will help us format and paste the code, but it seems that the result is not very satisfactory, such

 

After I copied the above Code to the following, VSC helped me adjust the indentation unneeded

 

Use the Undo key again to get the desired effect.

 

Theoretically, because of the automatic indent function, the Code pasted in the editor will be aligned with the above Code.

 

However, if the formatting plug-in is installed in VSC (the VSC plug-in includes the HTML formatting function), the following settings will be adjusted again after automatic indentation.

 

The purpose of this setting is to automatically help us Format this part of the code after we paste the code (if this function is available). By manually operating the Formatting Function, we find that this is true

 

Because there is no context constraint, the result of formatting code snippets is generally poor, especially when formatting a row, it will basically cancel all indentation. of course, this function is useful to some people, but it is better for me to disable it.

Code for automatic indentation, formatting, copying, and pasting of vscode

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.