I have a set of files and I applied the command %j! to all of them, to put
all contents into one line for each file.
When I open the resulting files in vim, as expected, the file is 1 line long
(although millions of characters). And the normal mode command G doesn't do
anything because the file is one line long.
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).
The annoying things is that matlab follows notepad's convention (not that of
vim)....
When I read the number of characters in the string, it INCLUDES the \n
that's present at the end of the notepad files, even though when I open
these files in vim and give the command /\n I get no results.
So I have to open EACH file in notepad and type "CTRL+end" and "backspace"
to remove this surplus \n at the end of each file, but there's no automated
way of doing thing (like in vim I could just use argdo).
So my question is, why does vim not have the \n at the end after pressing
%j! , while matlab and notepad seem to thing there IS a \n at the end ?? And
is there a way to modify the files with vim so that matlab and notepad don't
add this \n to the end ??
--
View this message in context: http://www.nabble.com/annoying-difference-between-vim-and-notepad-tp25108663p25108663.html
Sent from the Vim - General mailing list archive at Nabble.com.
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment