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:
this makes it so all your tabs and trailing whitespace is visible. note, this will make you hate almost every other developer.
[ Parent
| on HN ]
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 ;)
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...
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.
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>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'.