1

When searching:

\n is newline, \r is CR (carriage return = Ctrl-M = ^M)

When replacing:

\r is newline, \n is a null byte (0x00).

Why designed in such inconsistent way?

http8086
  • 1,306
  • 16
  • 37
  • @FDinoff hello, I want to know the reason of inconsistent, either of \n or \r is completely ok for me, what I care about is the inconsistent. – http8086 Aug 21 '14 at 13:49
  • From the duplicate http://stackoverflow.com/a/71531/1890567 – FDinoff Aug 21 '14 at 13:50
  • @FDinoff Ya, what's wrong if everything when replacing is the same just as when searching. – http8086 Aug 21 '14 at 13:58
  • 1
    http://stackoverflow.com/a/12389839/1890567. Vim was designed to be as backwards compatible as possible with vi. If there are inconsistencies it is almost always that. – FDinoff Aug 21 '14 at 14:04

0 Answers0