In normal mode (after pressing Escape), enter command:
:%s/\r//g
That will remove all CR characters. See:
http://vim.wikia.com/wiki/Change_end-of-line_format_for_dos-mac-unix
For the future, please:
- Use a suitable subject ("Remove carriage return").
If you can't think of a subject, don't send a question.
- Consider using a suitable name.
Why would anyone want to reply to "Vim Questions"?
John
You can either use the special-purpose dos2unix utility or do the following:
1. Load Vim (don't yet specify an editfile).
2. Read the file, accepting either CR+LF or LF alone (or any mixture of
them) as an end-of-line marker
:e ++ff=dos filename.txt
3. Write the file, outputting only LF (without CR) at the end of each line
:setlocal ff=unix
:w
4. (Optional, if you don't need Vim any longer)
:q
The above assumes Vim 7.2.040 or later. With earlier versions it's
possible but not as simple.
Also:
- To learn how to use Vim, run the Vim tutor.
- Next time, please use a more specific Subject line. See
http://www.catb.org/~esr/faqs/smart-questions.html about how to increase
the likelihood that your questions will be answered.
Best regards,
Tony.
--
Proverb: A nightingale that forgets the lyrics is a hummingbird.