[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [OT] CVS diff: hard vs. soft tabs



On Fri, Oct 10, 2003 at 09:48:34AM -0400, Nori Heikkinen wrote:
> i've been editing a lot of code over the past few months that was
> originally saved to disk with hard tabs for indenting.  i can't work
> with hard tabs, and so managed to reformat the entire thing to use
> spaces (basically a "s,^I,  ," iirc) before i began my massive
> overhaul of this file.
> 
> now it's time to check it into CVS.  i don't want every single line to
> show up as different just because of tab characters, so i need to find
> a good solution on how to transform my indents back into tab
> characters.  clearly the reverse -- "s,  ,^I," -- won't just work, as
> there are places where two spaces exist that i wouldn't want a tab.
> 
> is there some way to open the file in emacs (in which i assumer it was
> originally written; i use vim) and run it through a re-indentder with
> hard tabs on?  or could i do this in vim?

Perhaps you could set up vim's C indenting to produce the results you
want naturally, then run the whole thing through '='? You could also use
the 'indent' program, which has an insane range of options so can
probably reproduce most reasonable and unreasonable styles.

Cheers,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]



Reply to: