Since I need to share text files I work on with people who use
notepad, how can I set vim to use windows line endings?
Vim is pretty smart about automatically identifying line endings.
If you get files from your coworkers, they should be in CR/LF
format, and Vim should recognize these. If you're creating files
from scratch, and your local format is just a LF rather than
CR/LF, you can use
:set ff=dos
before writing. There is also the ability to override the format
upon reading/writing with
:e ++ff=dos /path/to/file.txt
:w ++ff=dos /path/to/file.txt
You can read more at
:help 'ff'
:help ++opt
-tim