Tuesday, May 24, 2011

RE: vim can't find carriage returns

JP Lew wrote:
> No matter which document I'm editing, whenever I search for a
> carriage return like this:
>
> /\r
>
> I get the following error message:
>
> E486: Pattern not found: \r

Vim removes line endings when a file is read, so there may not
be any CR in the buffer that is displayed. Search for \n to find
what Vim has detected as a line ending.

To convert from one line ending type to another, see:
http://vim.wikia.com/wiki/File_format

For testing, you can enter insert mode and type Ctrl-V Enter (or
Ctrl-Q Enter if you have mapped Ctrl-V to paste). That will
insert a CR displayed as ^M (Ctrl-M = 13 = CR). Searching for \r
will find it.

John

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

No comments:

Post a Comment