崇高的 3 个制表符和空格不匹配 [英] sublime 3 tabs and spaces do not match

查看:39
本文介绍了崇高的 3 个制表符和空格不匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经浏览了 3 次网页,但仍然没有解决方案.

I have browsed the web 3 times over but still no solution.

我有一个简单的 js 文件,我希望我的制表符是 4 个空格而不是 2 个.

I have a simple js file, and I want my tabs to be 4 spaces instead of 2.

我将首选项设置更改为标签大小为 4,更改了特定于语法的设置,所有内容,但仍然存在相同的问题.

I changed the preferences settings to tab size to be 4, chaged syntax specific settings, everything, but still same issue.

有什么想法吗?

推荐答案

点击状态栏上的缩进信息,即Tab Size: numSpaces: num,将显示一个上下文菜单.

Click On the indentation information on the status bar, that's where it says either Tab Size: num or Spaces: num, and a context menu will be displayed.

假设文件的起始位置使用空格和宽度为2的缩进,请按照以下步骤转换为空格和宽度为4的缩进.

Assuming the starting position of a file using indentation with spaces and a width of 2, follow the following procedure to convert to indentation with spaces and a width of 4.

从空格转换为制表符,更改宽度,然后再转换回空格,如下所示:

Convert from spaces to tabs, change the width, and then convert back to spaces, like this:

  • 取消勾选:使用空格缩进
  • 点击:将缩进转换为制表符
  • 勾选:标签宽度:4
  • 勾选:使用空格缩进
  • 点击:将缩进转换为空格
  • 就是这样.:)

如果您希望在所有文件中默认使用宽度为 4 的空格缩进,那么请在您的用户首选项中设置这些设置,并记住它们可以被您的项目设置和语法特定设置覆盖:

If indenting with spaces with a width of 4 is what you want to use by default in all your files, then set these settings in your user preferences and bear in mind that they can be overridden by your project settings and syntax specific settings:

// The number of spaces a tab is considered equal to
"tab_size": 4,

// Set to true to insert spaces when tab is pressed
"translate_tabs_to_spaces": true,

这篇关于崇高的 3 个制表符和空格不匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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