我希望我在 Sublime Text 中保存的所有文件都采用 Unix 行结束格式,即使我打开最初以不同格式保存但后来在 Sublime Text 中编辑的文件也是如此?
简单设定"default_line_ending": "unix"
还不够,因为这不会像我提到的那样转换 Windows 文件。我怎么做?
在 SublimeText3(可能是其他版本)中,您可以在用户首选项中定义它。
在菜单栏上打开“首选项 -> 设置”
在打开的右侧窗格中,您会发现您正在编辑“Preferences.sublime-settings -- User”。在该窗格中输入以下 JSON 格式的选项:
{
// 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",
// Display file encoding in the status bar
"show_encoding": true,
// Display line endings in the status bar
"show_line_endings": true
}
注意:我在这里添加了一些额外的功能。其中之一告诉您正在使用什么格式的文件以及该文件的编码格式。这些将出现在 ST3 应用程序底部的工具栏中。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)