On Monday, March 12, 2012 11:23:33 AM UTC-5, Günther Grantig wrote:
> I don't know whats the problem here as I thought TOhtml would do the 
> same thing as run syntax/2html.vim.
> 
> If I run vim by:
> vim foo.c -Es +TOhtml +"w! foo.html"
> 
> I get a plaintext foo.html, no HTML at all with an exit code 1. If I 
> change +TOhtml to +"run! syntax/2html.vim" it works perfectly - exit 
> code 0 and foo.html looks just like expected. As I figured out now it's 
> not -E it's the combination of -E and -s, as soon as I remove -s it 
> works with both versions.
> 

Adding a -V1 flag (turning verbose level to 1 in order to print messages to 
stderr with the -s flag) shows the problem: the TOhtml command is not defined. 
It appears that Vim starts in compatible mode and does not source the contents 
of the 'plugin' directory when started with both the -s and -E flags. Aha, it 
says in :he -s-ex, "Initializations are skipped (except the ones given with the 
'-u' argument)."

Here on my Windows system, starting as follows seems to work:

vim -u NONE -i NONE -E -s -N -c "runtime plugin/tohtml.vim" -c TOhtml 
temp\test.vim -c "saveas temp\test.vim.html" -c qa

However, there is no syntax highlighting, since the filetype detection and 
syntax highlighting is not turned on. Another couple of -c commands should do 
that, as well, or you can put this into a very small vim script which contains 
only the needed html_ variable settings and turning on syntax.

I think adding a relevant section to the :help for TOhtml is in order, telling 
how to run quickly in this fashion without errors.

-- 
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