Alessandro Pezzato Alessandro Pezzato - 6 months ago 74
C++ Question

Eclipse copy code with syntax highlighting

I'm writing a document of programming guidelines for my developers team. I use MS Word. We work with Eclipse CDT (C++). I need to copy-paste C++ code with syntax highlighting from Eclipse to Word. I've tried Notepad++ and it can export text with syntax highlighting, but it's highlighting is limited to basic syntax (it doesn't know about defined class, enum etc...).
Eclipse syntax highlighting is very powerful and I wish to export directly from Eclipse to Word using it's syntax highlighting.

Is there any Eclipse plugin that achieve this purpose? Or some trick to do it (without taking a screen snapshot)?


When you copy the code to word document, you can choose the option "keep source formatting" and the highlighting will be the same as the one in eclipse.


As mentioned in the comments below, this won't work on folded code, so you can right click on the line numbers and select Folding > Expand All