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


Oops! Disregard previous post.

What about -c "set fileformats=unix,dos,mac" ?

Best regards,
Tony.

Reply via email to