Friday, April 5, 2013

Line break without \n or \r?

I was puzzled by the second line break in the attached file. I want to
connect all lines that are next to each other (ie there is no blank
lines between them, the same way how tex defines a paragraph). So I
issue the following command:

:%s/\([^\\n]\)\n\([^\\n]\)/\1 \2/g

However, the result is

uuuu An
by y

Clearly there is something right after "An" that is not \n but produces
a line break. I also tried to replace \n with \r in the command, but it
does not work either. I tried various ways but could not find a reason
why the above command fails at the second line.

I find this issue when I tried to connect all the lines in a texfile
that forms a paragraph. There are always some lines that failed to be
connected and I can't seea reason. Anyone has a clue about this issue?

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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: