|
From: Keith M. <kei...@to...> - 2005-01-20 16:03:56
|
John Brown said: > Why do you consider an editor that adds characters that you did not > specifically request to be "civilised"? This newline business is a > requirement of C++, not text files in general. Suppose you are writing > in a language that has a similar idiotic requirement that your file > should *not* end with a newline? Hardly merits a reply, really. IMO, text files represent an organised collection of line oriented records. Each record is properly terminated by a newline marker. Any file lacking a terminating newline mark on its final record is either corrupt, or it is not a text file -- it is binary data. Vim has a binary mode, which will allow you to edit such files. You may not agree. That is your choice -- you want to be an idiot, I couldn't care less. You want to think of me as one, again, I couldn't care less. John Gaughan said: > I do not have Vim installed on this computer so I cannot check, but my > guess would be that it only does it for files it knows need it. There is a > "ftplugin" directory that holds scripts specifically for various file > types, including C and C++. Nothing to do with ftplugins. Standard vi, on SunOS 5.5.1 exhibits the same behaviour -- a valid text file, from vi's perspective, is an organised collection of line oriented records, and each is demarcated by a terminating newline. When vi opens a line to insert text, the terminating newline is inserted automatically. When the file is written out, vi ensures that each line is complete -- i.e. has a terminating newline mark. Regards, Keith. |