Change the colors for BBEdit's Invisibles feature

Jun 12, '09 07:30:00AM

Contributed by: CkB_Cowboy

I just posted this on my blog, and I thought it might be useful here too.

While I find BBEdit to be a fantastic text editor, there are a few minor things I've always wanted to change, one of which is the color for Invisibles. I love the idea, but against my preferred background color, they stand out far too much to be anything but distracting.

If you've never seen Invisibles, you can enable them for the current document in the Text Options menu of that window's toolbar, or globally by going to Preferences » Editor Defaults » Show Invisibles.

Now, if at first glance they seem obnoxious, imagine their color changed to be a bit more subtle, like just slightly darker or lighter than the background color. Sound better? Read on!

First of all, I recommend that you back up the ~/Library » Preferences » com.barebones.bbedit.plist prefs file, just in case. Then open a new Terminal window and paste this line in (and leave the window open afterwards):

export BBEDIT_COLOR=$(defaults read com.barebones.bbedit Color:Comment)
In BBEdit, go to Preferences Text Colors, and change the color for Comment to the color you'd like for Invisibles (feel free to actually throw some code and comments into a page to test with), then quit BBEdit.

In the same shell as before. run these commands:
$ defaults write com.barebones.bbedit Color:Invisibles:Spaces -string "$(defaults read com.barebones.bbedit Color:Comment)"
$ defaults write com.barebones.bbedit Color:Invisibles:Other -string "$(defaults read com.barebones.bbedit Color:Comment)"
$ defaults write com.barebones.bbedit Color:Comment -string "$BBEDIT_COLOR"
Open BBEdit, and you're done. You can close the shell now if you'd like. Notes: If you think Bare Bones should include proper configuration for Invisibles colors, let them know!

[robg adds: I haven't tested this one.]

Comments (1)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20090611071930139