Created
June 23, 2011 11:21
-
-
Save vagmi/1042379 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function! RTFHighlight(line1,line2,...) | |
| if !executable('highlight') | |
| echoerr "Bummer! highlight not found. Get it from http://www.andre-simon.de/doku/highlight/en/highlight.html" | |
| return | |
| endif | |
| let content = join(getline(a:line1,a:line2),"\n") | |
| let command = "highlight --syntax " . a:1 . " -s bipolar -R -k Menlo -K 24 2> /dev/null" | |
| let output = system(command,content) | |
| " let @* = output | |
| " for some reason text copied this way | |
| " gets pasted as plain text in keynote | |
| " but this works well with pbcopy | |
| let retval = system("pbcopy",output) | |
| endfunction | |
| command! -nargs=1 -range=% RTFHighlight :call RTFHighlight(<line1>,<line2>,<f-args>) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment