How to change ^M line break to 'normal' line break in a file Which is opened using VIM Editor

Most of the experienced with ^M line break characters in opened files in Vim editor. Please find the solution below to change in to normal

 %s/ Ctrl-V Ctrl-M //g

In the above statement

 Ctrl-V Ctrl-M means type Ctrl+V then Ctrl+M. 
Explanation
:%s --> substitute
 ^M characters (the Ctrl-V is a Vim way of writing the Ctrl ^ character)
//
with "" (NULL) characters (the character between the 2 forward-slash / characters)
g --> And do it globally (not just the first occurrence on the line).
Happy learning ..:)
SHARE

    Blogger Comment
    Facebook Comment

1 comments :