Reese Knowledgebase

Setting file formats in VIM

View Kristian Reese's profile on LinkedIn

If you like this article, please +1 or Recommend via FB with the provided buttons above:

Article ID: 43
by: Reese K.
Posted: 11 Jul, 2012
Last updated: 11 Jul, 2012
Views: 1594

Sometimes, my scripts will be in DOS format with that pesky CR (Carriage Return) ^M charater and the end of each line.  A simple way to rid your file of it is to set the file format in a vim session as follows:

:set ff=unix

Otherwise, the ^M can be created by depressing the ctrl-v+m key combo (keep ctrl held down for both key presses of v and m), and you can do a substitution.

Here's a cool wiki on end of line formats.

This article was:   Helpful | Not Helpful
Prev   Next
Using wget to download iso from rhn     How to decode a base64 string