Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I wrote a vim syntax highlighting file for a custom file type that I am working and I want to be able to show off my syntax highlighting painlessly by converting my view of the page into an HTML document for others.

My current workflow is basically:

vim *.ext

and then:


ad nauseum

I'm sick of it, I've exported 3 files this way and I've had enough. How can I streamline this using some sort of script?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Try this:

for i in *.ext; do vim -c TOhtml -c wqa $i ; done
share|improve this answer

Create a recursive mapping:

:map <F2> :TOhtml<enter>:wq<enter>:n<enter><F2>

And then press <F2>. All your files will be converted automatically.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.