A.J.Mechelynck wrote:
For a single file:

    :e ++ff=dos foobar.txt
    :setlocal ff=unix
    :w

For all *.txt files in the current directory:

    :set fileformats=dos
    :args *.txt
    :set nomore
    :argdo setl ff=unix | w
    :set more " assuming this is your preferred setting
----
        Neat...will have to give it some more thought at some point.
I did it the quick & lazy way using perl & the windows cygwin command line:

/Prog/Vim> \                       # start in VIMRUNTIME dir (Drive C assumed)
perl -pi \                         # edit files "in-place"
  -e 's/\r//g' \                   # execute "Delete CR" 'script'
  $(                               # use "subshell" to create argument list
                                   #    for the perl "script" to edit
    find . -type f \               # find all files in VIM dir
    -exec file {} \; | \           # get "type" of each file
    grep CRLF | \                  # only keep lines containing CRLF files
    cut -d\: -f1 | cut -c 3-| \    # cut fluff off line & leave FileName (FN)
    tr "\n" " "                        # put all FNs on 1 line
  )                                # end subshell leaving FNs as args to perl

Reply via email to