Tuesday, March 5, 2013

Coloring comments in Vi/Vim in readable colors

Just a quick one today: Many people like me - read: traditionalists - like their terminals white-on-black. Today, whether you want it or not, you get saddled with pretty, pretty coloring in vim, ls, whatnot... with the small downside that they tend to assume you are using a white background. My eye doctor thinks dark blue writ on black background is a wonderful idea - so does my optometrist. Small wonder, they make money on selling eyeglasses. Small wonder, I disagree with them there - for some reason I treasure my 25/20ies. If you do as well, the most obvious solution is a :syntax off in vim. Which is, truth to tell, far from the best. What few people know, vim actually comes prepared for black backgrounds - that is just disabled in most distros.


Here's how to change that: open /etc/vim/vimrc and uncomment (or add, for that matter) the following line:

set background=dark
 
Save, start another vim, enjoy your new-found eye-strain-free syntax coloring

That's all for now. Don't worry, I'm going to make this post pretty later ;)