【问题标题】:Sublime text change the indentation according to the file extensionsublime text 根据文件扩展名改变缩进
【发布时间】:2021-04-24 19:38:23
【问题描述】:

我知道如何更改文件中的默认缩进:sublime text 的首选项,但我想知道是否可以告诉 sublimetext:当它是一个 .rb 文件时,你必须将选项卡大小设置为 2,当它是.html 你有 4 个标签大小。 是否可以使其自动化?

【问题讨论】:

    标签: html ruby sublimetext3 indentation


    【解决方案1】:

    在您的 Ruby 语法设置中 $SUBLIME_PATH/Packages/User/Ruby.sublime-settings 设置 tab_size = 4

    {
      "tab_size": 4 // by the way it is 2 for Ruby by conventions
    }
    

    对于$SUBLIME_PATH/Packages/User/HTML.sublime-settings中的HTML设置tab_size

    {
      "tab_size": 2
    }
    

    或者你可以打开一个 HTML 文件并转到 preferences > settings - syntax specific,sublime 将打开 HTML 的设置文件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-03-26
      • 1970-01-01
      • 1970-01-01
      • 2015-05-12
      • 2012-03-07
      • 2013-07-07
      • 2015-05-13
      • 1970-01-01
      相关资源
      最近更新 更多