Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In our project different developers use different editing tools. Some use vim, some use eclipse. The nature of the project requires some files with DOS line endings, some with Unix line endings. It sometimes happens that the line ending type gets mixed up in files. Vim users do not have this problem because each file contains a commented "modeline" that looks like

/* vi: set fileformat=dos: */


# vi: set fileformat=unix

near the EOF which tells vim to do the right thing.

Can eclipse be made to do the same on a per-file basis? I.e. can I tell eclipse within a file "This is a DOS file; save it with DOS line endings and convert if needed."?

Note: it is not an option to

  • force vim on developers
  • add file properties in eclipse that need to be maintained
  • run external tools
share|improve this question
File ---> Convert Line Delimiters To ---> Unix || Windows || Mac OS 9
share|improve this answer
But that's a manual operation. The question is how to do this automatically, as indicated in the file itself. – Jens Nov 14 '11 at 7:50

There is EditorConfig. It allows specifying text file specific config options such as line endings or indentation in a standardized way. There are plugins for both Vim and Eclipse.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .