One way to overcome the line-ending problem when working on multiple operating systems is to use your revision control system.
For example, Subversion can be configured to automatically checkout files with the correct line endings based on the platform on which you are running. If you check-in a file on Windows using CRLF line endings, then checkout the same file under Unix, Subversion gives you LF endings instead.
See here for further information:
http://svnbook.red-bean.com/en/1.4/svn.advanced.props.file-portability.html