Saturday, February 2, 2008

Vim of Cygwin to Set default file format

If create a bash file under cygwin using vim, the default configuration of vim stores the bash file in the format of dos, therefore the bash file can not execute correctly.

To store the currently editting file in the format of unix:

:set fileformat (or ff)=unix

If I want to change the default file format of vim to unix, add this code into the .vimrc and .gvimrc file under my home directory:

set fileformats=unix,dos

No comments: