>
> However, when I open the exact same file in windows notepad, all the
> contents are on one line, EXCEPT that there's a \n at the end of the string
> of characters (there's a 2nd line that is empty... and I have to press
> "CTRL+end" and "backspace" to remove this last line).
>
Well, it seems no problem, just different program treat the line
differently.
For notepad and many windows-based programs: \n is not part of a line,
they treat \n as the separator between two lines, so if the last
character of a text file is \n, it will think the last line is an empty
line. (but there will not be an empty line in Vim)
For Vim and most unix-based programs: \n is not a separator, it is part
of a line, all lines must end with \n, so the last character of a text
file will always be \n. (In the whole Linux world, text file without \n
is an invalid or corrupted text file, a C program without an \n ending
may be an error in gcc)
This is the trend, and I think the unix way is actually better. Think if
you need to concatenate two text files? In windows-way you need to
append \n to the first file then do the concatenation, in unix-way you
only need to concatenate two text file.
So, all you can do is: leave the blank line there.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment