Printing code with syntax highlighting?

后端 未结 13 2200
轻奢々
轻奢々 2021-02-01 16:00

I have occasion to need to print code (Horrors!!! ;) ), and i was wondering what editor or tool would i use to print that code out with proper formatting and syntax highlighting

13条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-01 16:33

    Use vim. Its the easiest method to do it in my experience by far, that is, once you know how.

    Vim comes pre-installed on Macs, btw. And I know how you special people like colors, so I'm going to make this impatientbusinessman-proof for the benefit of all.

    1.) open file

    vim filename.m

    2.) enable syntax coloration (mine did not have enabled by default)

    :syntax on

    3.) print

    :hardcopy
    

    Vim will choose your system's default printer without asking you so make sure you set that up first.

    4.) exit the program (this is actually not a given)

    :q
    

    OR

    Use Aptana. Aptana is pretty sweet, its free and it has great ftp functionality.

提交回复
热议问题