newbie: use <CR> in RE?

Jez Hancock jez.hancock at munk.nu
Sat Nov 22 05:29:52 PST 2003


On Sat, Nov 22, 2003 at 09:00:26PM +0800, Zhang Weiwu wrote:
<snip>
> This is also a problem in vi(1). Besides <CR> I wish to manipulate 
> tabstops and line-feeds with RE too.
I'm not sure about vi, but in vim this works:

:%s/\n//

to remove all newlines throughout a document.  

To substitute all tabs in this text:

one	two	three

with newlines, one would do:

:s/\t/\r/

on that line - using '\r' instead of '\n'.  Not entirely sure why '\r'
is used in this context instead of '\n'.

-- 
Jez Hancock
 - System Administrator / PHP Developer

http://munk.nu/


More information about the freebsd-questions mailing list