Inserting a CRLF in VI

Can any one tell me how do we insert a CRLF from inside the vi in a text file ?!!!


Thanks in advance.
srinusimhadriAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ahoffmannConnect With a Mentor Commented:
CRLF: Ctrl-V Return Return
or:   Ctrl-V Ctrl-M Ctrl-V Ctrl-J
# depends on your stty settings
0
 
yuzhCommented:
try to use:

   CTRL-v CTRL char,

   eg, for change to new page, type in:
       Ctrl v Ctrl L (hold ctrl and press v, hold ctrl press l)
       for CR:
       Ctrl v Ctrl m

       it depends on your UNIX favour.

0
 
srinusimhadriAuthor Commented:
is there no way we can tell vi to use CRLF for line breaks ?
0
 
ahoffmannCommented:
depends on your vi version.
traditional AT&T vi does not produce useless characters (CR:-).
But most vi clones have a

     :set textmode

if not, you need to use the UNIX's prorietary unix2dos converter (the name varies on UNIX flaviours), or use a simple tr or perl command.
0
 
tfewsterCommented:
No comment has been added lately, so it's time to clean up this Topic Area.
I will leave a recommendation for this question in the Cleanup topic area as follows:

- Answered by ahoffmann

Please leave any comments here within the next 7 days

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

tfewster
Cleanup Volunteer
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.