【问题标题】:Making sublime save new files out with LF lineendings despite being run on windows?尽管在 Windows 上运行,但使用 LF lineendings 使 sublime 保存新文件?
【发布时间】:2012-12-17 04:26:14
【问题描述】:

我现在在 Windows 上运行 sublime text,每次我创建一个新的代码文件并保存它时,它总是以CRLF 出现,无论我将菜单选项设置为“unix”多少次。

在可能的范围内,我想将 sublime 设置为永远不会再用 Windows 行结尾写出另一个文件。

我该怎么做?

【问题讨论】:

    标签: newline text-editor sublimetext2


    【解决方案1】:

    您可以将设置文件中的default_line_ending 设置为unix,如下面的简化示例所示。设置文件可以在“首选项”>“设置”菜单选项中找到。这将适用于新文件。这是我的首选项文件中的一个小 sn-p,它设置为“unix”。

    {
        // Determines what character(s) are used to terminate each line in new files.
        // Valid values are 'system' (whatever the OS uses), 'windows' (CRLF) and
        // 'unix' (LF only).
        "default_line_ending": "unix",
    }
    

    还有一些额外的documentation of this on the sublime text site

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-08-02
      • 2020-05-06
      • 1970-01-01
      • 2017-08-28
      • 1970-01-01
      • 1970-01-01
      • 2021-06-30
      • 1970-01-01
      相关资源
      最近更新 更多