Re: git and trailing whitespace



On Wed, 2009-05-06 at 10:40 +0100, Bastien Nocera wrote:
> On Wed, 2009-05-06 at 11:18 +0200, Loïc Minier wrote:
> > On Wed, May 06, 2009, Lennart Poettering wrote:
> > > I just have these lines in my ~/.emacs:
> > > (autoload 'nuke-trailing-whitespace "nuke-trailing-whitespace" nil t)
> > > (add-hook 'write-file-hooks 'nuke-trailing-whitespace)
> > 
> >  This sounds like it would remove all trailing whitespace in any file
> >  you touch; that sounds like a pretty bad idea for thinks like "blame"
> >  and will probably generate huge diffs for small changes -- or is this
> >  only about new code you're writing?
> > 
> >  I use vim and it displays trailing whitespaces as blue dots for me:
> >   set list
> >   set listchars=tab:>-,trail:.,extends:>,precedes:<,nbsp:%
> >  (the relevant config above is "trail:."; I find the other ones useful
> >  as well)
> 
> Eek. That'd look bad. I believe this line is from Xavier's vimrc:
> set listchars=eol:•,tab:↦\ ,trail:»,extends:↷,precedes:↶ 

Another alternative is just highlight them in red.

highlight BadWhitespace ctermbg=red guibg=red

if has("autocmd")
    autocmd FileType c,cpp syntax match BadWhitespace /\s\+$/
endif

-- 
Germán Póo-Caamaño
Concepción - Chile
http://www.gnome.org/~gpoo/

Attachment: signature.asc
Description: This is a digitally signed message part



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