在Eclipse文本编辑器中,如何重新格式化/填充/对齐一段80个字符的段落? [英] In the Eclipse text editor, how can I reformat / fill / justify a paragraph to 80 characters wide?

查看:75
本文介绍了在Eclipse文本编辑器中,如何重新格式化/填充/对齐一段80个字符的段落?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Eclipse中编辑文本文件(例如README文件)时,我还没有找到一种方法来使编辑器重新设置文本段落的格式,以使其适合合理的宽度(通常为80个字符)。这似乎是一件很普通的事情,但我还没有发现。有人可以帮忙吗?

When editing text files in Eclipse, for instance, a README file, I have not yet found a way to get the editor to reformat paragraphs of text so that they fit in a reasonable width (typically 80 characters). This seems like it should be a very common thing to want to do, but I haven't found it. Can anyone help?

请注意,这里我不是在谈论软文本换行-我想敲击某些组合键并让Eclipse插入并删除实际的换行符,以便在基本文本编辑器中查看时,该文件看起来不错。本质上,与Emacs上的填充段落功能相同。我知道某些特定的源代码编辑器具有可处理注释的智能重新格式化程序,但是基本的文本编辑器似乎没有任何内容。

Note that I'm not talking about soft text wrapping here - I want to hit some key combination and have Eclipse insert and remove actual newline characters so that the file looks OK when viewed in a basic text editor. Essentially, the same thing that the 'fill-paragraph' function on Emacs does. I'm aware that certain specific source code editors have intelligent reformatters that work with comments, but the basic text editor doesn't seem to have anything.

如果这不行,不存在,我可能不得不自己去写点东西...

If this doesn't exist I may have to go and write something myself...

推荐答案

不,Eclipse无法格式化纯文本文件

No, Eclipse is not able to format plain text files.

但是,有一种解决方法:创建一个新的空Java类,将文本放在注释中( / * ... * / ),然后单击源->格式(Ctrl + Shift + F)。

But, there is a workaround: create a new empty Java class, place your text inside comments (/* ... */), and click Source -> Format (Ctrl+Shift+F).

这篇关于在Eclipse文本编辑器中,如何重新格式化/填充/对齐一段80个字符的段落?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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