On 12/26/06, Yongwei Wu wrote:
Maybe try

:help 'fileformats'
:setg fileformats?

I've read the help page, but I don't manage to deduce a solution out
of it. Without -u NONE it works OK, but if I say
   vim -u NONE -c "set fileformats=unix,dos" filename
it diesn't really help. fileformats is properly set, but fileformat is
still set to unix.

Mojca


On 12/26/06, Mojca Miklavec wrote:
> Hello,
>
> two of us are experimeting with using vim as an external
> syntax-highlighter for TeX documents.
>
> This file resulted from adapting 2html.vim:
>     http://pub.mojca.org/tex/vim/syntax/2context.vim
>
> Here's how vim is called now:
>
> vim -u NONE
>            -e
>            -V10log
>            -c "set nocp"
>            -c "syntax on"
>            -c "set syntax={filetype}"
>            -c "source 2context.vim"
>            -c "wqa" {filename}
>
> However, after using "-u NONE" (in order to assure compatibility among
> different users), I now have problems converting [dos] files on linux.
> If I take a [dos] file, I get
>
> first line^M
> second line^M
>
> etc. I temporary solved the problem by adding
>     let s:line = substitute(s:line, '\r', '', 'g')
> but this will fail for mac fileformat.
>
> So: how should the function be implemented, so that reading will work
> for any combination of endline characters (<CR><NL>, <NL> and <CR>) on
> any system? It's only important to read it properly, writing mode is
> not that important since TeX can hopefully handle any of the three
> possibilities.
>
> Thanks a lot for any hints,
>     Mojca

Reply via email to