views:

93

answers:

4

I'm going to a farm, I think there's no computers there and my laptop is broken. I want to print the code of some of my projects so I can make code review while I'm there. I'll be nice if the syntax highlight is printed too.

Editors: Vim, Notepad++

Code: Html, CSS, Javascript

P S : I don't know if I didn't explain myself very well, but I want to print syntax highlight in a paper (A4).

+4  A: 

enscript

pygmentize

Ignacio Vazquez-Abrams
Up vote for pygmentize
Vestel
@Mark: http://pygments.org/docs/lexers/
Ignacio Vazquez-Abrams
OK never mind. PS here's a much more appropriate link for this question, given the languages he wants: http://pygments.org/docs/lexers/#lexers-for-web-related-languages-and-markup I found it from the page you linked to.
Mark Byers
+1  A: 
  • a2ps tool produces nice PostScript files for program listing printing.

  • Vim has :TOhtml command which produces HTML with current open file highlighted according to Vim syntax coloring. GVim has Syntax -> Convert to HTML menu for this.

  • If you use LaTeX, look at listings package (pdf documentation at CTAN). It's a very good solution for including your code in documentation/presentation.

All these tools support syntax of many programming (and non-programming) languages.

Ilia K.
Vim also has `:hardcopy > output.ps` to print to PostScript instead of HTML.
jleedev
+1  A: 

In emacs use ps-print-buffer-with-faces. There is also ps-print-region-with-faces for those occasions when you only want part of a file...

Use M-x <command> to invoke commands by name. Use C-h f <command> for help on a command and also to learn what (if any) keybinding it has.

dmckee
Vote up for emacs
FUZxxl
+1  A: 

Editplus prints with syntax highlighting intact

Paolo