视觉工作室代码更改缩进 [英] visual studio code change indentation

查看:124
本文介绍了视觉工作室代码更改缩进的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于每个打字稿文件,visual studio代码使用8个空格的自动缩进。这对我来说有点太过分了,但是我找不到改变它的地方。

也许它可以作为一个设置,但是使用不同的名字,找到与缩进相关的任何东西。

解决方案

在右下角的工具栏中,您会看到一个如下所示的项目:
点击它后,您将可以使用空格或制表符来选择缩进。选择您的缩进类型后,您将可以选择更改缩进大小。在上面的例子中,缩进被设置为每个缩进4个空格字符。如果选中tab作为缩进字符,那么您将看到制表符大小而不是空格符



如果您想要有这适用于所有文件,而不是在个人文件的基础上,重写 editor.tabSize editor.insertSpaces 设置在用户设置工作区设置中根据您的需要

For every typescript file visual studio code uses an auto indentation of 8 spaces. This is a bit too much for my taste but I can't find where to change it.

Maybe it's available as a setting but under a different name as I can't find anything related to indentation.

解决方案

In the toolbar in the bottom right corner you will see a item that looks like the following: After clicking on it you will get the option to indent using either spaces or tabs. After selecting your indent type you will then have the option to change how big an indent is. In the case of the example above, indentation is set to 4 space characters per indent. If tab is selected as your indentation character then you will see Tab Size instead of Spaces

If you want to have this apply to all files and not on an idividual file basis, override the editor.tabSize and editor.insertSpaces settings in either User Settings or Workspace Settings depending on your needs

这篇关于视觉工作室代码更改缩进的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆