News for hackers. Stuff that matters.
Re:Ask HN: What's in your .vimrc file? by throw_away on Thursday October 01, 2009 @09:27PM (#856241)
someone mentioned listchars elsewhere, but I prefer these glyphs:

    set listchars=tab:»·,trail:·
    set list
this makes it so all your tabs and trailing whitespace is visible. note, this will make you hate almost every other developer.
Re:Ask HN: What's in your .vimrc file? by lux on Thursday October 01, 2009 @09:30PM (#856249)
Indeed! I can't do it any more, just filled me with so much hate... It's like people use the spacebar just to think.

/rant ;)

Re:Ask HN: What's in your .vimrc file? by lux on Thursday October 01, 2009 @09:32PM (#856252)
And to answer the poster, I tend to just use the default vim. I'm bouncing around machines so much that I don't bother setting anything up on my main one that I'll miss on the others...
Re:Ask HN: What's in your .vimrc file? by lucasoman on Friday October 02, 2009 @08:31AM (#856868)
My cure for that is putting my .vimrc on my site; then, from a foreign machine, I just do:

wget -O ~/.vimrc http://lucasoman.com/vimrc

And just like that, I'm in my comfort zone. Of course, this doesn't cover plugins and such, but I don't use those very often.

Re:Ask HN: What's in your .vimrc file? by meese_ on Thursday October 01, 2009 @11:22PM (#856374)
Here's a function I wrote to get rid of trailing white space:

    fun! s:RemoveWhitespace()
    	if &bin | return | endif
    	if search('\s\+$', 'n')
    		let line = line('.')
    		let col = col('.')
    		sil %s/\s\+$//ge
    		call cursor(line, col)
    		echo 'Removed trailing whitespace.'
    	else
    		echo 'No trailing whitespace found.'
    	endif
    endf
You can map it with:

    nn <silent> ,R :cal<SID>RemoveWhitespace()<cr>
Re:Ask HN: What's in your .vimrc file? by pyre on Friday October 02, 2009 @12:38AM (#856454)
Going into an old codebase and just running ':set list' with just the default listchars is maddening enough. The mixes of tabs and whitespace characters is enough to drive one batty. Especially when you find files where someone was using tabs, but with the 'ts=8' or 'ts=2' rather than 'ts=4'.