/copy-with-style

An Atom package that allows you to copy syntax highlighted code to the clipboard.

Primary LanguageJavaScriptMIT LicenseMIT

Copy with style!

Ever which you could just copy the code from your editor into document or presentation, WITH the syntax highlighting? Well, now you can!

Demo where code is copied from Atom into Google docs with the syntax highlighting preserved.

Options

You can create presets in the settings, up to three of them, available using alt+a 1 - alt+a 3. A preset is a named combination of:

  • Output format, RTF or HTML.
  • Font face and size.
  • Background color.
  • Optional external command, if not provided it will fall back to the default behaviour and copy the result to the clipboard.

This gives you pretty free reign as to how you want to consume the result. I use it with a simple ruby script to get the proper format on the clipboard in OS X to paste correctly into Google docs.

Take a look at the repository Wiki for that script. Feel free to contribute with your own creations as well.