chebe: (South Park)
chebe ([personal profile] chebe) wrote in [community profile] command_liners2009-12-14 10:20 am

vim and syntax-highlighting in reports

Hey all, [personal profile] foxfirefey swung by my journal and let me know about this community. I think it's a fantastic idea, so I present to you my humble offering:

Ever wanted to make all that source code in your report/webpage much more readable by adding syntax highlighting, and specified formatting? Well, before you reach for the snapshot tool, try vim.

:TOhtml


Produces a html formatted version of your file, syntax highlighted the way vim does things. Just save it, open in a browser, and copy-paste into your text processor. Voilá!

P.S. I haven't tried vi, anyone know if it works there too?
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)

[personal profile] afuna 2009-12-14 10:52 am (UTC)(link)
*wow* that is all kinds of awesome. I added :let html_use_css=1, as well and it is absolutely perfect now. It even linkifies things that look like links, and um. Wow!

No idea if it works in vi; looks like everything I have, vi is an alias for vim.
sophie: A cartoon-like representation of a girl standing on a hill, with brown hair, blue eyes, a flowery top, and blue skirt. ☀ (Default)

[personal profile] sophie 2009-12-14 12:05 pm (UTC)(link)
It won't; syntax highlighting is a vim thing.
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)

[personal profile] afuna 2009-12-14 02:29 pm (UTC)(link)
Awww, good to know. Thanks *g*
sophie: A cartoon-like representation of a girl standing on a hill, with brown hair, blue eyes, a flowery top, and blue skirt. ☀ (Default)

[personal profile] sophie 2009-12-14 12:05 pm (UTC)(link)
I agree with [personal profile] afuna; I never even knew about this. Thanks! :D