Using Rich-Text Copy in IntelliJ IDEA 14.1

Posted on by Dmitry Batrak

IntelliJ IDEA 14 added built-in support (without additional plugins required) for copying text to external rich-text editors such as MS Word, OpenOffice Writer, Gmail, etc. allowing for preserving formatting.

IntelliJ IDEA 14.1 makes it more flexible, allowing you to choose when to use this feature. You can choose to enable this behavior by default when using the standard Copy action. All that’s need is to enable the following checkbox in Settings:

richTextCopy

With this enabled, if you want the old behavior of standard copy (i.e. with no additional formatting)
you can use a separate action (Copy as Plain Text or Copy as Rich Text) from the Edit Menu entry or the editor’s context menu:

copyAsAction

These actions do not have default shortcuts assigned, but you define them in Keymap settings if you find yourselves using one of them often.

Try this and other enhancements by downloading IntelliJ IDEA 14.1 EAP build. Share your feedback on the discussion forum and in our issue tracker. Thanks!

Comments below can no longer be edited.

6 Responses to Using Rich-Text Copy in IntelliJ IDEA 14.1

  1. Jean-François Héon says:

    March 10, 2015

    I love this feature! It makes for professional snippets inside of emails.

    Thank you!

  2. E. Sundin says:

    March 6, 2016

    Awesome! I’m using the Dracula theme but need the rtf copies with white background. Luckily you can set the copy color scheme with IntelliJ 😀

    • Roshan says:

      March 16, 2017

      How do you do this? I’m using PHPStorm and the background is annoying me when copying

      • Roshan says:

        March 16, 2017

        Never mind, I found it at Settings>Editor>General:Rich-text copy

  3. Richard "Virgo" Richter says:

    November 8, 2016

    I noticed the change at some time and always pasted unformatted and didn’t understand why IDEA does it by default. Today I got really angry when formatted code pasted to a chat (Skype for business in this case) and then copied by a colleague to IDEA refused to work although seemingly perfect. The trouble is that all spaces were switched to U+00a0 (nbsp). But this blogpost was helpful – I turned it off and I can use explicit copy as rich text anytime I really need it. I have never needed it so far though, because any formatting is done by something else (e.g. javascript syntax highlighting) and – as explained – it made any code copy/pasted from/to IDEA through “incomaptible” tool unusable (although visually flawless :-)).

  4. Jarad says:

    February 18, 2017

    THIS was driving me CRAZY today. I can just hear developers saying, “It’s a feature, not a bug.” It’s a HORRIBLE default feature for new users. I would paste, and it would always return a new line. Do this a hundred times after being unsuccessful in finding which of the million settings this was.

Subscribe

Subscribe for updates