Is there a simple way to copy syntax-coloured code block as rtf in intellij IDEA?
Select the portion of code you'd like to copy, then go the Edit menu and select Copy Special -> Copy as RTF. Your code, complete with syntax highlighting colors, is now stored on the clipboard. Simply press Ctrl + V in your other application to paste the code with syntax highlighting. It's that simple!
Copy the text that you want to paste. When C::B console runs, right-click on its top window border (where the name of the executable appears). This will produce a menu. Select Edit -> Paste, and the copied text will be pasted at the cursor in the console.
Copy pathsPress Ctrl+Shift+C to copy the absolute path to the current file. Choose Edit | Copy Path/Reference from the main menu. In the popup that opens, choose what part of the path you want to copy — filename, absolute, or relative path.
Duplicate the current line or selectionPress Ctrl+D or choose Edit | Duplicate Line or Selection from the main menu . Alternatively, you can press Ctrl+Shift+A , start typing the command name in the popup, and then choose it there.
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:
Copies a snippet of code as html
- Adds menu items "Copy as HTML" to main menu and editor popup. Will copy the current selection or the complete editor buffer. Currently only works if focus is in editor (for example won't work in project tree).
- Preserves more formatting than the built-in HTML export.
- HTML is only a snippet (without html and body tags) meant to be inserted into a complete HTML document.
- Currently HTML format is fixed and uses CSS a lot.
- Options: unindent, add border, padding, line numbers, tabs to spaces conversion, include editor's warning and error highlighting (see IDE Settings -> Copy as HTML).
- Reuses the editor "Show Line Numbers" setting (see Idea's "View" menu).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With