[conspire] (forw) Re: About vim and mac files ...

Rick Moen rick at linuxmafia.com
Wed Jul 1 15:43:13 PDT 2009


I don't think Peter will mind the fact that this public posting quote
his mail.

Honestly, I think this methind is often best:

:set ff=unix  #Set endline to LF only
:set ff=mac   #Set endline to CR only
:set ff=dos   #Set endline to CR LF

...then writing to disk a file tailored for the target's OS's ASCII fetish.

----- Forwarded message from Rick Moen <rick at linuxmafia.com> -----

Date: Wed, 1 Jul 2009 14:54:32 -0700
From: Rick Moen <rick at linuxmafia.com>
To: Peter Belew <abcruzww at gmail.com>
Subject: Re: About vim and mac files ...
Organization: Dis-

Quoting Peter Belew (abcruzww at gmail.com):

> I was wondering why my vim didn't automatically recognize mac-format
> files - apparently it's necessary to have the phrase
> 'fileformats=unix,dos,mac' in one's .exrc file.
> 
> Maybe this is a default that my .exrc was overriding by default.
> 
> http://www.vim.org/htmldoc/usr_23.html
> 
> So at the moment I've changed my .exrc to
> 
>   set sw=2 autoindent nowrapscan ic fileformats=unix,dos,mac
> 
> "so many options, so little time"

Thanks for the tip!  I'd completely forgotten about that.


----- End forwarded message -----
----- Forwarded message from Rick Moen <rick at linuxmafia.com> -----

Date: Wed, 1 Jul 2009 15:30:20 -0700
From: Rick Moen <rick at linuxmafia.com>
To: Peter Belew <abcruzww at gmail.com>
Subject: Re: About vim and mac files ...
Organization: Dis-

Quoting Peter Belew (abcruzww at gmail.com):

> Not knowing about that, I didn't expect that. But I haven't tried
> without any .exrc file. :)

I _thought_ it worked without "fileformats=mac", but could well be
wrong.

You might or might not want to have those directives in a .vimrc file,
instead.

Of course, this search and replace has always worked fine:

:%s/\r/\n/g
or:
:%s/<CNTRL+V><CNTRL+M>/\r/g
or:
:%s/^V^M/^V^M/g

Note to mention just doing:

:set filetype=unix
or (equivalently):
:set ff=unix


----- End forwarded message -----




More information about the conspire mailing list