On Wed, Jun 15, 2011 at 10:37 AM, Ben Fritz <fritzophre...@gmail.com> wrote:
>> You can also speed it up a little but by using:
>>
>>   let g:html_no_progress = 1
>>
>
> Other options which might speed things up slightly (if their effects
> are acceptable):
>
> g:html_ignore_folding = 1 or g:html_dynamic_folds = 0 (otherwise Vim
> scans every line for fold information, twice, before starting the
> conversion)
>
> g:html_use_encoding = "UTF-8" (or whatever encoding you desire) to
> avoid Vim needing to determine the encoding to use (probably VERY
> minor savings, but it can also avoid a conversion on write if the
> specified encoding matches your 'encoding' setting)
>
> g:html_expand_tabs = 0 (probably very minor savings, but this will
> prevent Vim from doing processing on tab characters to replace them
> with spaces; mostly this is useful if you do NOT use line numbers or a
> fold column in the generated output)
>
>

One more to try, if you don't care about conceal support:

g:html_ignore_conceal = 1

This will eliminate at least one check per syntax item, and I suspect
(but have not verified) that the inner loop for non-concealed items
(always used with ignore_conceal set) is faster than for concealed
items. But again, this is probably minor savings. The biggest savings
will probably be from the html_no_progress option, and from disabling
syntax highlighting on the generated HTML output.

I'm interested to learn what you end up with. I thought a few times
about a use case like this, but decided it was unlikely because TOhtml
is pretty slow for big files.

Also note, Zyx has a plugin very similar to 2html, with a slightly
expanded feature set, several possible output formats, and probably a
very different implementation. If you do go with a Vim method, you can
try it out. I don't think there's been very much comparison done
between the two, it could be faster (or it could be slower, I really
have no idea).

http://www.vim.org/scripts/script.php?script_id=3113

Also, I have an item on my TODO list to allow the HTML output to use
an external CSS file. My goal is that this external file can be
generated just once and then used over and over, and that by not
processing the CSS every time additional speed increases will be
possible. I do not have an ETA on this feature, however; it has mostly
stalled in the design stage until I find time to work on it again. If
this is interesting enough I can probably put some other features on
hold which I had planned on getting to first (automatic font
detection, and uncopyable regions for things like line number and the
fold column).

-- 
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to