Eclipse中自动EOL转换 [英] Automatic EOL conversion in Eclipse

查看:262
本文介绍了Eclipse中自动EOL转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我知道Eclipse首选项为新创建的文件设置新的线条样式,但是我想对已有的文件进行自动转换。有没有一些设置/插件?



我只想设置一次,并确保所有行结尾都是相同的格式。

解决方案

除了 Window>首选项>一般> Workspace 设置您已经知道的新文件,有一个文件>将行分隔符转换为选项。我不知道任何现有的插件/工具,将自动自动保存,但你可以写一个或使转换行结束部分的过程。



为了使自己更容易,您可以通过转到 Window>将键盘快捷键绑定到转换命令。首选项>一般>键并使用delimiter进行过滤:


Need to keep EOL format consistent in all resources under Eclipse workspace.

I know about Eclipse preference that sets new line style for newly created files, but I would like to have automatic conversion for already existing files. Is there some settings/plugins?

I want just setup once and be sure that all line endings are in the same format.

解决方案

In addition to the Window > Preferences > General > Workspace setting for new files that you already know about, there is a File > Convert Line Delimiters To option. I don't know of any existing plugin/tool that will do this automatically when you save, but you could certainly write one or make converting the line ending part of your process.

To make it easier on yourself, you can bind keyboard shortcuts to the conversion commands by going to Window > Preferences > General > Keys and filtering using "delimiter":

这篇关于Eclipse中自动EOL转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆