5 ms·
Save Vim syntax highlighting to HTML
- jmah 18y agoThe standard shortcut for this is :TOhtml (although I always screw it up and type :toHTML). Of course, you can ":help TOhtml" to get more info.
- 13ren 18y agovim can do anything you can imagine, better than you imagined. If only you knew the command... One for me was word completion to match other words in the file (^n, where ^ is control), but based on filenames (^x^f^n).
- nfg 18y agoFor emacs see htmlfontify.el ( http://www.emacswiki.org/emacs/HtmlFontify http://www.emacswiki.org/emacs/HtmlFontify ).
- kzar 18y agoOr htmlize.el (http://www.emacswiki.org/emacs/Htmlize http://www.emacswiki.org/emacs/Htmlize ).
- Hovertruck 18y agoNow if only I could bring myself to put font tags anywhere near a page. :\
- mileszs 18y agoYou don't have to. As jmah said above, :TOhtml is the standard way to do it. First, you can issue the command :let html_use_css = 1. Highlight some code and enter :TOhtml, and you'll have non-font-tag-ified, css-ified HTML that uses your syntax highlighting.
- mapleoin 18y agonow someone should write a blogpost comparing that to using http://pygments.org/ http://pygments.org/