https://github.com/minimaxir/copy-syntax-highlight-osx
Copy Syntax Highlight for OS X is an OS X service which copies the selected text to the clipboard, with proper syntax highlighting for the given language.
https://github.com/minimaxir/copy-syntax-highlight-osx
Last synced: about 1 month ago
JSON representation
Copy Syntax Highlight for OS X is an OS X service which copies the selected text to the clipboard, with proper syntax highlighting for the given language.
- Host: GitHub
- URL: https://github.com/minimaxir/copy-syntax-highlight-osx
- Owner: minimaxir
- License: mit
- Created: 2015-11-11T05:02:33.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-19T06:04:41.000Z (over 9 years ago)
- Last Synced: 2025-03-29T17:31:18.438Z (about 1 month ago)
- Size: 1.71 MB
- Stars: 380
- Watchers: 7
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- starred-awesome - copy-syntax-highlight-osx - Copy Syntax Highlight for OS X is an OS X service which copies the selected text to the clipboard, with proper syntax highlighting for the given language. (Others)
README
# Copy Syntax Highlight for OS X
Copy Syntax Highlight for OS X is an OS X service which copies the selected text to the clipboard, with proper syntax highlighting for the given language.

## Usage
The intended primary use case is to Paste the copied syntax highlighted-text into productivity applications such as [Word](https://products.office.com/en-us/word), [Keynote](http://www.apple.com/mac/keynote/), and [Photoshop](http://www.photoshop.com), while keeping the code highlighting intact. Such highlighting can then be used in documents for publication and presentations for more spark, so to speak.

To use the tool, install the the [pygments](http://pygments.org) Python package. Then [download the Service](https://github.com/minimaxir/copy-syntax-highlight-osx/blob/master/Copy%20Syntax%20Highlight.zip) from this repository and install. On any text in any application, select the text and context-click, and the "Copy Syntax Highlight" menu item will be available. A prompt will appear asking for the language to lex the syntax highlight.
A [Dark theme](https://github.com/minimaxir/copy-syntax-highlight-osx/blob/master/Copy%20Syntax%20Highlight%20Dark.zip) is also available, intended for highlighted code text placed on dark backgrounds.

## Theming
The Service is separated into two themes: the normal theme (which uses the pygments `default` style), and the dark theme (which uses the pygments `monokai` style). To change the style used, open the service in Automator and change the corresponding style in the Get Specified Text action.

## Author/Maintainer
Max Woolf ([@minimaxir](http://minimaxir.com))
## Credits
Idea was inspired by comments on [this GitHub Gist](https://gist.github.com/jimbojsb/1630790), which linked to [this Stack Overflow](http://apple.stackexchange.com/questions/94222/how-to-get-automator-to-treat-text-as-rtf/94246#94246) answer which serves as the core function.
Example GIF uses code sourced from [learnpython.org](http://www.learnpython.org/en/Hello,_World!). The GIFs in this README are rendered using the [Video to GIF OS X tool](https://github.com/minimaxir/video-to-gif-osx).
## License
MIT