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