Settings to copy paste with correct indentation in Visual Studio Code Ask Question

Settings to copy paste with correct indentation in Visual Studio Code Ask Question

When I copy and paste a piece of code using Visual Studio Code, after pressing enter to create a new line, the following happens:

ここに画像の説明を入力してください

It seems to keep the indentation created by the new line, adding the previous information from the copied snippet on top of it. I'd rather the code was auto-beautified on paste.

この動作は設定で変更できますか?

編集: クロスプラットフォームのコピー アンド ペーストではなく、Visual Studio Code 内の同じファイル内でのコピー アンド ペーストについて言及しています。

ベストアンサー1

"editor.formatOnPaste": trueこれは、設定のプロパティを使用して、すでに vscode に統合されています。

おすすめ記事