subversion-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Shahaf <...@daniel.shahaf.name>
Subject Re: Revert only whitespace changes
Date Tue, 14 Jun 2011 23:16:25 GMT
Daniel Shahaf wrote on Wed, Jun 15, 2011 at 02:07:00 +0300:
> > Bonus points for a tool which keeps real indentation changes, and only
> > discards tab<->space conversions which do not change the indentation
> > level. :-)
> 
> vim -c 'source /dev/mind-reader' -c 'wq'
> 
> Not all OS's provide the necessary device file, though.

Okay, more seriously, here's a Vim script...

The first two lines are the configuration, you shouldn't have to change
anything below them.


:set tabstop=8 shiftwidth=8
:set expandtab

:g/^/call MaybeRetab()
func! MaybeRetab()
  normal! ^
  let before = virtcol('.')
  .retab
  let after = virtcol('.')
  if before != after
    undo
  endif
endfunction

Mime
View raw message