简体   繁体   English

如何在Visual Studio代码中粘贴代码格式

[英]How to paste the code format in visual studio code

I want to paste the code format in Visual Studio Code. 我想将代码格式粘贴到Visual Studio Code中。 In sublime or IntelliJ, the hot key Ctrl + Shift + v will be able to past the code format with automatic indent. 在sublime或IntelliJ中,热键Ctrl + Shift + v可以自动缩进代码格式。 I have found a lot, but have not found any similar hot key in Visual Studio Code. 我发现了很多,但是在Visual Studio Code中没有找到任何类似的热键。 Does any one have a good suggestion? 有没有一个好的建议? What you should notice is that my point is to paste the code, but not only format the code. 您应该注意的是,我的意思是粘贴代码,而不仅是格式化代码。 My purpose is not just to format the code. 我的目的不仅仅是格式化代码。

There is an extension that solves this problem. 有一个扩展程序可以解决此问题。

Paste and Indent 粘贴和缩进

You also have to bind a key combination to trigger paste with indentation. 您还必须绑定组合键以触发带有缩进的粘贴。 You'll find the "how to" on the link above. 您将在上面的链接中找到“操作方法”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM