From: Earnie B. <ear...@ya...> - 2002-05-14 15:50:06
|
Luke Dunstan wrote: > ----- Original Message ----- > From: "Earnie Boyd" <ear...@ya...> > To: "Luke Dunstan" <cod...@ho...> > Cc: "mingw-msys" <min...@li...> > Sent: Tuesday, May 14, 2002 9:05 PM > Subject: Re: [Mingw-msys] postinstall on Windows 9x > > > Well I do nocompatible but the MSYS runtime won't do text mode anyway. > > This is not an issue, because vim converts between DOS and Unix manually, > not by opening files in text mode. > Yes it does! :) > > > > > > If this is how you use it, I strongly recommend setting the > > > "nocompatible" option in .vimrc so that the line endings are detected > > > automatically and preserved (along with enabling many other features). > If > > > you do this, you can easily tell whether all lines have \r because if > so, > > > you will not see any ^M. You can save files in a different format by > setting > > > the "fileformat" option before writing. And yes, I am sure you could use > > > ":autocmd" to automatically save *.bat files as DOS. > > > > > > > So this still doesn't get the ^M on the end of the line. I'll need to > massage > > vim for MSYS in that department with explicit writes of \r in nobinary > mode. > > This did work for me. > - I put "set nocompatible" in ~/.vimrc > - did "vi test.txt" > - typed in a few lines > - typed command ":set fileformat=dos" > Ah, that did it. I modified my /usr/share/vim/vim58/filetype.vim file to read (watch out for line wrapping): " Batch file for MSDOS (*.cmd is close enough) au BufNewFile,BufRead *.bat,*.sys,*.cmd set ft=dosbatch|set nobin|set ff=dos Thanks, Earnie. |