Skip navigation.
Home

Konverze unixdos ve VIMu

To jsem nasel na http://vim.sourceforge.net/tips/tip.php?tip_id=145, tak si to sem znamenam:

Those of us doomed to work in both the Unix and Windows world have many times encountered files that were create/editted on systems other that the one we are on at the time of our edits. We can easily correct the dreaded '^M' at the end of our Unix lines, or make files have more than one line in DOS by:

To change from <CR><LF> (DOS) to just <LF> (Unix):
:set fileformat=unix
:w


Or to change back the other way:
:set fileformat=dos
:w


It also works for Apple land:
:set fileformat=mac
:w


And to tell the difference:
set statusline=%<%f%h%m%r%=%{&ff}\ %l,%c%V\ %P