Search code examples
eclipseideformattingrichtext

Is there a way to copy code from the Eclipse IDE without the rich-text formatting?


Recently every time I copy a block of code from Eclipse and paste the code into TextEdit or a online forum using the code tags, I get the code with the rich-text or html formatting, so I have to copy into a text editor remove the formatting copying and pasting again, In the past this was not a problem I used to copy from eclipse and paste the code without any formatting at all just as plain-text, I dont know if I turn on a property or what I did for this to happen, any ideas how to fix this?


Solution

  • Note: the rich formatting from a SWT editor seems to have always been available (bug 64498).

    You could use "Edit, Paste and Match Style" in TextEdit.

    From the Edit menu, choose Paste and Match Style,
    or use the keyboard shortcut, Shift Option Command V.

    The pasted text will pick up all the formatting from the character to the left of the flashing insertion point. This technique works in Mail as well.