Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to copy from Sublime Text 3 with formatting?

I have XML in Sublime Text 3 and I would like to use it as an example in Google Slides. The issue is when you copy the text you end up with plain text, I would like to keep the syntax highlighting as it makes it much easier to read. Is this possible? Is there some Sublime package I need?

like image 718
James Mudd Avatar asked May 13 '19 13:05

James Mudd


People also ask

How do I copy in Sublime Text?

Just move the cursor to the line you want to copy and Ctrl-C (Cmd-C on Mac). Do not select the line, just stay on it. Then paste it anywhere you want to paste, and it will insert a new line before the one your cursor is on, with the previously copied text.

Can I use Sublime Text for CSS?

4.0. Sublime Text contains a custom HTML and CSS engine, named minihtml, for displaying stylized content in editor panes. HTML content can be displayed in both popup windows and phantoms.


2 Answers

Open the package control to install a package (Ctrl/Cmd + Shift + P):

enter image description here

Look for Highlight and click it:

enter image description here

Done! You can now right click some text and copy it as RTF:

enter image description here

Then you can paste that in Google Slides, PowerPoint, Word, Outlook, whatever you like.

like image 139
MS Berends Avatar answered Sep 28 '22 15:09

MS Berends


I use CopyAsHtml pakage. It is better than SublimeHighlight pakage. You can install it according to what MS Berends said above.

CopyAsHtml pakage keeps sublime coloring exactly.

It will add another copy as HTML in your right click as you can see below. enter image description here

like image 33
javad m Avatar answered Sep 28 '22 17:09

javad m