Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #!/bin/zsh
  2. #
  3. # Highlight a given file and copy it as RTF.
  4. #
  5. # Simon Olofsson <simon@olofsson.de>
  6. #
  7.  
  8. set -o errexit
  9. set -o nounset
  10.  
  11. # 1. Run pygmentize
  12. # 2. Set the fontsize to 30 Points (=60 half-points)
  13. # 3. Remove all newlines
  14. # 4. Remove trailing paragraph, to prevent a line break
  15. # 5. Copy the result to the clipboard
  16. pygmentize -f rtf -O 'fontface=Monaco,style=monokai' $1 | sed 's;\\f0;\\f0\\fs60;g' | tr -d '\n' | sed 's;\\par}$;};' | pbcopy
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement