2

I normally use VIM to edit my codes and convert them to HTML by using TOhtml command. The only thing I don't like is that the converted HTML does not have css class style definitions. I am not sure if there is tool to convert codes to HTML with css, or I can use additional tool or command to convert HTML HTML with css?

4
  • 1
    I think I got the answer. Type the commman: let html_use_css=1. Then TOhtml will create a html with css classes. Commented May 26, 2010 at 22:35
  • 1
    It is perfectly acceptable to answer your own question on stack overflow if you figure out a solution on your own. Commented May 28, 2010 at 3:35
  • You can even accept your own answer. And maybe even get yourself a badge into the bargain. stackoverflow.com/badges/14/self-learner Commented May 31, 2010 at 14:09
  • Related: How to convert a source code file into HTML? at Vim SE Commented Feb 19, 2015 at 15:20

1 Answer 1

8

Here I copy my comments as my answer:

Type the command:

let html_use_css=1

Then

:TOhtml 

it will create a html with css classes. For more information and other options for TOhtml command, you can get help by:

:help TOhtml
Sign up to request clarification or add additional context in comments.

1 Comment

There should not be a dot after the :let html_use_css=1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.