Re:Show HN: Generate high-res images of code samples with Ch...
by sabarasaba on Tuesday September 12, 2017 @03:01AM
(#15225351)
You can also do :TOhtml, then open the html file with your browser and print to pdf. A bit simpler imo.
1. Open your script/code in vim editor
2. Enable syntax & set the required color scheme
:syntax on :colorscheme darkblue
3. Print the file in PS file format
:hardcopy >/tmp/filename.ps
4. Convert the PS file to PDF format
$ ps2pdf /tmp/filename.ps
5. Now you can open filename.pdf