Thursday, October 1, 2020

Retaining the color code in Notepad++

 When you open a supported file format in Notepad++, it performs syntax highlighting where it formats the text with various colors to make reading easier.

However, when you save the file or copy text from it to an external program, all of the syntax highlighting and formatting is lost, and the text will take on formatting of the program you’re pasting into. This shouldn’t be surprising as the program is basically a plain-text editor. The syntax highlighting you see is just a visual enhancement. Although, there is a way to retain this formatting, i.e. if you have NppExport plugin installed. Latest builds of Notepad++ ships with this plugin. If you don’t have NppExport installed, you can download it through the inbuilt plugin manager.

When you have it ready, highlight the code that you want to copy, then go to 

Plugins (on the menu bar) > Select NppExport > Copy all formats to clipboard

Now when you paste the code into a program that supports rich text formatting, for example Microsoft Word or Evernote, all of the formatting should be retained.

No comments:

Post a Comment

इश्क में ग़ैरत-ए-जज़्बात ने रोने ना दिया - सुदर्शन फ़ाकिर

 इश्क में ग़ैरत-ए-जज़्बात ने रोने ना दिया वरना क्या बात थी किस बात ने रोने ना दिया आप कहते थे कि रोने से ना बदलेंगे नसीब उमर भर आप की इस बात...