to <cr> or not

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Les Mikesell wrote:
> On Wed, 2006-03-01 at 11:23, Bowie Bailey wrote:
> > > 
> > > In the old days with real vi, you would:
> > > :%s/^v^m//
> > > to get rid of them, but vim doesn't like that.
> > 
> > It depends on how Vim recognizes the file.  If Vim displays the file
> > as a DOS file, it will hide the ^M and you can't search for it.
> > If Vim displays the file as a unix file, it will show the ^M at the
> > end of the line and you can search and replace it with the command
> > shown above.
> 
> OK, but what would convince vim to display files with ^M's as
> unix files?  I thought it took their presence as the hint to
> display in DOS mode.

A screwed-up text file that doesn't have the ^M's on every line will
display this way in Vim.  This tends to happen when you transfer a DOS
file to unix and then edit it with a program that does not do the
conversion for you.  The resultant file has ^M at the end of every
line except ones you added with the unix editor.

-- 
Bowie

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux