Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== fileformats ====== * http://www.vi-improved.org/wiki/index.php/FileFormat ===== Fixing Detection Problems ===== If your file has consistent line endings throughout, but you have had a 'ff' detection problem, the best fix is to force Vim to use the correct format with the :e command: <code> :e ++ff=mac </code> If your file **does not** have consistent line endings throughout, you need to force vim to load it a certain way without any assumptions. This example is where the output from a grep command was run and captured to a file. Some of the results were from dos files, and others from unix files, so the line endings aren't consistent, and vim shows us ^M characters because it is interpreted as unix. <code> :set ffs=dos :e ++ff=dos </code> 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: <code> :w :e! </code> ===== conversion ===== This will read a file (assuming "dos"), convert line-endings to unix (<CR><NL> pairs will be <NL>): <code> :e file :set fileformat=unix :w </code> docs/vim/fileformats.txt Last modified: 2009/06/24 17:39by billh