Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Jan 2004 16:15:09 +0100
From:      Bernard El-Hagin <zaphod@neostrada.pl>
To:        freebsd-questions@freebsd.org
Subject:   Re: how to get rid of ^M character using vi
Message-ID:  <u6n710dmdpmq1npothk0kmu0juqnviiqvt@4ax.com>
In-Reply-To: <200401250152.46526.kstewart@owt.com>
References:  <BAY13-F62bUpm0RnzXo00012ad5@hotmail.com> <200401250152.46526.kstewart@owt.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Kent Stewart <kstewart@owt.com> wrote:

>On Sunday 25 January 2004 01:43 am, marlon corleone wrote:
>> how do i get rid of this annoying character ^M using vi, in pico i
>> used the arguments '-w'
>> but what about in vi?
>
>
>starting on the 1st line type
>:.,$s/<ctrl>v<ctrl>m//
>
>The .,$ tells it to process from the current line to the last one.


If you're doing this for the whole file it's faster to use %


:%s/<ctrl>v<ctrl>m//


It's even faster to use


:se ff=3Dunix


but that assumes we're talking about Vim, not Vi.

--=20
Cheers,
Bernard



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?u6n710dmdpmq1npothk0kmu0juqnviiqvt>