137087Re: Line break without \n or \r?
- Apr 6, 2013Hello Paul,
Paul <pywpeng@...> a écrit:
> I was puzzled by the second line break in the attached file. I want toThis:
> 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.
works ok. To me, "[^\\n]" doesn't mean much ("[^\n]" would be better),
and anyway your original form corrected wouldn't work either for
one-character lines (since that character would be used by the pattern
to join the current line to the previous one, and couldn't be reused
to join the current line to the next one).
> I find this issue when I tried to connect all the lines in a texfileA simpler way is to use "vipJ", meaning "select the current paragraph
> 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?
and join the lines" (see ":help v_j").
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@....
For more options, visit https://groups.google.com/groups/opt_out.
- << Previous post in topic Next post in topic >>