gpt4 book ai didi

Eclipse 和 Windows 换行符

转载 作者:行者123 更新时间:2023-12-02 08:35:57 30 4
gpt4 key购买 nike

当我的桌面崩溃时,我不得不将 Eclipse 工作区从 Linux 移动到 Windows。一周后我把它复制回Linux,愉快地编码,提交给CVS。唉,Windows 换行符已经污染了许多文件,因此 CVS diff 会转储整个文件,即使我更改了一两行!

我可以编写一个脚本,但我想知道它是否会弄乱我的 Eclipse 项目文件。

最佳答案

如上所述herehere :

Set file encoding to UTF-8 and line-endings for new files to Unix, so that text files are saved in a format that is not specific to the Windows OS and most easily shared across heterogeneous developer desktops:

  • Navigate to the Workspace preferences (General:Workspace)
  • Change the Text File Encoding to UTF-8
  • Change the New Text File Line Delimiter to Other and choose Unix from the pick-list

alt text

  • Note: to convert the line endings of an existing file, open the file in Eclipse and choose File : Convert Line Delimiters to : Unix

提示:您可以通过在 Package Explorer 中选择然后转到菜单项 File : Convert Line Delimiters to : Unix 来轻松转换现有文件。

关于Eclipse 和 Windows 换行符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1886185/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com