Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copying text with color from Notepad++

Is there a way to copy the text from a Notepad ++ file with color?

I am trying to write a tutorial document, and I would to be able to copy the xml tags.

Thanks!

like image 452
user620189 Avatar asked Jun 03 '11 15:06

user620189


People also ask

Can you color code in notepad?

You can't. You can only do word wrap and stylize the font for all of your notepads.

How do you copy a color code?

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!

How do you copy text in Notepad?

From the NotePad tab, select the cell of information you want to cut or copy. To cut the information, click Cut on the speedbar. To copy the information in the cell, click Copy on the speedbar. Select the cell where you want to paste the information.


5 Answers

There's a plugin called NppExport that does just that in a couple of available formats. If you don't have NppExport yet, you can download it through the inbuilt plugin manager.

update As of version 6.1.5 (or maybe earlier) this ships with a standard install of Notepad++

enter image description here

update As of 2019 NppExport is not included by default in the Notepad++ 64 bits version (github issue). You can download the 64 bits version of NppExport here: [github]

like image 175
raveren Avatar answered Sep 29 '22 13:09

raveren


In NPP v6.7.7 you can do this by selecting your text, right clicking on it, select "Plugin commands" and then "Copy text with syntax highlighting".

like image 45
greycloud Avatar answered Sep 29 '22 13:09

greycloud


To built on Raveren answer : Copy HTML to clipboard didn't for me (for a .bat), I had to select plugins/NppExport/Export to HTML instead and then open the html in a browser and copy the text from there.

like image 44
MagTun Avatar answered Sep 30 '22 13:09

MagTun


It works fine when you choose copy with right click plugin commands and copy text with syntax highlighted.

like image 27
Gururaj Birajdar Avatar answered Oct 01 '22 13:10

Gururaj Birajdar


For Notepad++ 64-bit releases you can find the NppExport plugin here: https://github.com/chcg/NPP_ExportPlugin/releases

I've tested "NppExport_0.2.8.16_x64.zip" with Notepad++ v7.5.4.

like image 45
RoadVampire Avatar answered Sep 29 '22 13:09

RoadVampire