[Yanel-dev] Vim configuration for Yanel development

Mehmet Birgi mehmet.birgi at wyona.com
Thu Apr 1 16:00:45 CEST 2010


I did a little research on the web, and apparently the " \ No newline at end
of file" message is not really a bug, but more of a feature :-)

C compilers (and maybe others) expect each file to be terminated with a \n,
and will object otherwise. This seems to be the reason why Vim always adds
this character if it is not present already. For more reasons for having a
\n at the end of files, see:
http://stackoverflow.com/questions/729692/why-should-files-end-with-a-newli=
ne

Unfortunately, I couldn't find a simple way to change this behaviour.

cheers,

memo



2010/4/1 Guillaume D=E9flache <guillaume.deflache at wyona.com>

> Michael Wechner schrieb:
>
>  Dear Guillaume
>>
>> Thanks very much for sharing this.
>>
>> Just being curious, but did I as a vi(m) user do anything wrong? Or is
>> just a general hint/pointer?
>>
>
> Oh no, sorry for the confusion: memo could not quite find how to do it, so
> I dug it up from my configuration files.
>
>
> BTW any idea if there is an option to stop Vim from always adding a line
> ending for the last line of a file when it is missing?
>
> For example:
> $ echo -n foo > bar
> $ vim bar # just save it as baz, i.e. :wq baz
> $ env LANG=3DC diff -u bar baz
> --- bar 2010-04-01 15:26:58.000000000 +0200
> +++ baz 2010-04-01 15:29:20.000000000 +0200
> @@ -1 +1 @@
> -foo
> \ No newline at end of file
> +foo
> $
>
> This is the single thing I do not know how to control that makes Vim
> produces unwanted differences.
> So all in all Vim is very fine for cooperative development indeed! :)
>
> --
> Yanel-development mailing list Yanel-development at wyona.com
> http://lists.wyona.org/cgi-bin/mailman/listinfo/yanel-development
>



-- =

Mehmet Birgi
www.wyona.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wyona.org/pipermail/yanel-development/attachments/2010040=
1/e3091f70/attachment.htm


More information about the Yanel-development mailing list