Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 days 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 (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-19T06:04:41.000Z (about 9 years ago)
- Last Synced: 2024-10-22T18:20:44.016Z (about 2 months ago)
- Size: 1.71 MB
- Stars: 381
- Watchers: 8
- 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.
![](/img/syntax_highlight.gif)
## 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.
![](/img/hello-world.gif)
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.
![](/img/deep4me.png)
## 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.
![](/img/theme.png)
## 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