Sublime Forum

Copy rich text to clipboard


I’ve long wanted a way to copy formatted, rich text out of sublime, and I finally found the Highlight plugin.

It has issues though. And it’s quite old. For example, I have to use RTF because HTML only comes out as source (on my Mac). And the default text colour is blank, which doesn’t work well if you have a black background.

Is there any thought to make building this in to Sublime? Is all the information available to write a proper plugin which literally copies the styles from the buffer? The highlight plugin just lexes and then applies a theme to the result, but that’s obviously not as nice as literally copying the styles that are on display.



Maybe this plugin would help ExportHtml?



I also found the ExportHtml plugin just now. It uses the current theme properly, so it can be done!

It doesn’t, however, successfully copy HTML to the clipboard such that it can be pasted into an email message. Instead, the HTML source is pasted.

Did that ever get sorted out?

It also opens a safari window even though I asked it not to, which is a drag except I can actually copy the HTML from there and put that into my email. It’s an extra step though …

Am I using it wrong?

    "keys": ["ctrl+super+alt+h"],
    "command": "export_html",
    "args": {
        "numbers": false,
        "table_mode": false,
        "browser_print": false,
        "view_open": false,
        "no_header": true,
        "clipboard_copy": true,
        "multi_select": true,
        "style_gutter": false