On 12/26/06, A.J.Mechelynck wrote:
Mojca Miklavec wrote:
> 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
If it works for you without -u NONE but not with it, it may mean that the
settings are set too late (i.e., after loading the file and setting its
'fileformat' erroneously to "unix" or to the empty string.
Try replacing -c by --cmd in order to apply the commands _before_ reading the
editfile.
Using "--cmd" instead of "-c" did the trick indeed. I now use
vim -u NONE --cmd 'set fileformats=dos,unix,mac'
which works perfectly.
Thanks a lot for your quick help!
Mojca