Eclipse 中的字/行计数工具
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2702136/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Word/Line count tool in Eclipse
提问by Stan
Is there any tool or plugin can do this? CodeBlock has this neat tool which is really nice. Wonder if it's available on Eclipse. Thanks.
有什么工具或插件可以做到这一点吗?CodeBlock 有这个非常好的工具。想知道它是否在 Eclipse 上可用。谢谢。
采纳答案by Josh Sterling
http://metrics.sourceforge.netcan do lines. I'm not sure about words however.
http://metrics.sourceforge.net可以做线。但是,我不确定单词。
回答by forivall
For newlines, use file search, and search for \n (with regular expressions enabled) in all of the files you want.
对于换行符,请使用文件搜索,并在您想要的所有文件中搜索 \n(启用正则表达式)。
For words, you can just make your search term for \w+
对于单词,您可以将搜索词设为 \w+
The count is the number of matches! If you want anything fancier, make a fancier regex.
计数是匹配的数量!如果您想要更高级的东西,请制作更高级的正则表达式。
Source: http://www.binaryfrost.com/index.php?/archives/207-Easy-way-to-count-Lines-of-Code-in-Eclipse.html
来源:http: //www.binaryfrost.com/index.php?/archives/207-Easy-way-to-count-Lines-of-Code-in-Eclipse.html
回答by stacker
Linenumber is always displayed on the lower right corner, and left if you use the context menu an left side of your edit window and check "Show Line Numbers".
行号始终显示在右下角,如果您使用编辑窗口左侧的上下文菜单并选中“显示行号”,则显示在左下角。
Google>: "eclipse word count" shows that many people had the same problem and developed plugins.
谷歌>:“eclipse word count”显示很多人有同样的问题并开发了插件。