Sunday, May 23, 2010

Re: vim says error messages in linux machine not in windows machine

On 17/03/10 15:42, Reid Thompson wrote:
> On Wed, 2010-03-17 at 23:24 +0900, Dewr wrote:
>> I have been using vim in windows-machines and appreciate vim.
>> Today I copied my vimrc and vimfiles to the linux-machine and ran vim.
>> But vim just said error messages!
>> One thing I can fix was this -> "VIM CAN'T PARSE changing line without
>> any content(\n=^M)!"
>> But other error messages are so ridiculous for me.
>> Help me.
>
> the windows files use MS-DOS line endings, vim on unix requires unix
> line endings
>
> do the following on the unix box
>
> dos2unix .vimrc
> dos2unix .gvimrc
>
> dos2unix any other files you transferred from the windows box
>
> or
> retransfer the files from the windows box to the unix box using ftp in
> ascii mode to have the line endings translated automatically
>
>
>

or alternatively, in (a recent version of) Vim (opened with -u NONE -N
if on Linux and you want to avoid the error messages):

:e ++ff=dos ~/.vimrc
:setlocal ff=unix
:w
:e ++ff=dos ~/.gvimrc
:setlocal ff=unix
:w

etc. for any Vim scripts that you transferred. ++ff=dos is only
necessary if you have mixed CR/LF and LF-only endings in the same file
(or CR/LF endings, but no line ending on the last line), but it doesn't
hurt otherwise.

You can do this on Windows before transfer or on Linux afterwards; Vim
for Windows can, as said, use scripts ([._]vimrc, [._]gvimrc, *.vim)
with either Unix or Dos line-endings and can edit them both; Vim for
Unix can still edit them both but not source scripts with Dos line
endings; if you want to edit files with Unix line endings on Windows
without Vim, use Wordpad in preference to Notepad (which has, at least
in some versions, a tendency to choke on LF not preceded by CR).


Best regards,
Tony.
--
Reality is an obstacle to hallucination.

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

No comments:

Post a Comment