Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
docs:vim:fileformats [2007/03/25 21:09] – created billh | docs:vim:fileformats [2009/06/24 17:39] (current) – billh | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== fileformats ====== | ||
+ | * http:// | ||
+ | ===== Fixing Detection Problems ===== | ||
+ | If your file has consistent line endings throughout, but you have had a ' | ||
+ | < | ||
+ | :e ++ff=mac | ||
+ | </ | ||
+ | |||
+ | If your file **does not** have consistent line endings throughout, you need to force vim to load it a certain way without any assumptions. | ||
+ | < | ||
+ | :set ffs=dos | ||
+ | :e ++ff=dos | ||
+ | </ | ||
+ | In this case you should see vim list [CR missing] in the status line after loading the file. Vim has fixed the line endings for you, so now you can simply do this to save the file and open it as a corrected dos file: | ||
+ | < | ||
+ | :w | ||
+ | :e! | ||
+ | </ | ||
+ | |||
+ | ===== conversion ===== | ||
+ | This will read a file (assuming " | ||
+ | < | ||
+ | :e file | ||
+ | :set fileformat=unix | ||
+ | :w | ||
+ | </ |