在intelliji IDEA中将语法颜色的代码块复制为rtf?
有没有一种简单的方法可以在intellij IDEA中将语法颜色的代码块复制为rtf?
Is there a simple way to copy syntax-coloured code block as rtf in intellij IDEA?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
更新:现在有一个新的插件:'Copy' on steroids 由 JetBrains 维护。
无法直接从 IDEA 复制彩色代码块。
解决方法是使用 File |导出为 HTML,然后在浏览器中打开 HTML,然后从浏览器窗口复制并粘贴到 Wordpad 或 MS Word 中。
另一种更快的方法是安装 复制为 HTML 插件设置|插件:
UPDATE: there is now a new plug-in for this: 'Copy' on steroids that is maintained by JetBrains.
There is no way to copy colored code block from IDEA directly.
A workaround is to use File | Export to HTML, then open HTML in a browser, then copy from the browser window and paste into Wordpad or MS Word.
Another and more faster way is to install the Copy as HTML plug-in in Settings | Plugins:
IntelliJ IDEA 15
默认情况下,您可以将富文本从 IntelliJ 复制到 Microsoft Word(例如)。
此功能可以在文件>中找到。设置...>>编辑>一般>富文本复制>默认复制为富文本
您还可以仅更改复制粘贴操作的配色方案(您当前的配色方案不会受到影响)。
IntelliJ IDEA 15
By default, you can copy rich text from IntelliJ to Microsoft Word (for example).
This feature can be found in File > Settings... > Editor > General > Rich-text copy > Copy as rich text by default
You can also change the color scheme only for the copy-paste operation (your current scheme won't be affected).
使用外部工具notepad++
1)复制代码片段到notepad++
2)应用语法高亮
3)使用nppexport插件将rtf格式复制到剪贴板
Use external tool notepad++
1) copy code snippet to notepad++
2) apply syntax highlighting
3) copy with nppexport plugin to clipboard as rtf
如果您使用的是 Mac 并且喜欢 TextMate,这里有一个从 TextMate 复制样式代码的好方法: https://github.com/bblimke/copy-with-style-tmbundle
它不像直接从 IntelliJ 中那样方便,但比使用 gist 或 Pastebin 方便一点。此外,与 IntelliJ 的 Copy as HTML 插件不同,此解决方案在撰写本文时实际上有效。
If you're on a mac and like TextMate, here's a great way to copy styled code from TextMate: https://github.com/bblimke/copy-with-style-tmbundle
It's not as convenient as doing it directly from IntelliJ, but it's a bit more convenient than using gist or pastebin. Also, unlike the Copy as HTML Plugin for IntelliJ, this solution actually works at the time of this writing.