【发布时间】:2012-12-17 04:26:14
【问题描述】:
我现在在 Windows 上运行 sublime text,每次我创建一个新的代码文件并保存它时,它总是以CRLF 出现,无论我将菜单选项设置为“unix”多少次。
在可能的范围内,我想将 sublime 设置为永远不会再用 Windows 行结尾写出另一个文件。
我该怎么做?
【问题讨论】:
标签: newline text-editor sublimetext2
我现在在 Windows 上运行 sublime text,每次我创建一个新的代码文件并保存它时,它总是以CRLF 出现,无论我将菜单选项设置为“unix”多少次。
在可能的范围内,我想将 sublime 设置为永远不会再用 Windows 行结尾写出另一个文件。
我该怎么做?
【问题讨论】:
标签: newline text-editor sublimetext2
您可以将设置文件中的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",
}
【讨论】: