Question

I'm using Vim to work on a project with others developers using Windows.

The problem: I get "^M" characters instead of line-breaks. This can be solved with this simple command

:set fileformats=dos

But when I restart Vim, the file is opened again with the unix format. Another problem is that I have to execute the command for each file in the directory.

Is it possible to set this parameter for a whole directory?

Was it helpful?

Solution

The fileformats option is global. The fileformat option however is local to each buffer.

With the following command you can check how those are set:

:verbose set ff? ffs?

In my .vimrc I have set the following:

set fileformats=unix,dos,mac

And it Just Works.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top