Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Change the colors for BBEdit's Invisibles feature' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Change the colors for BBEdit's Invisibles feature
Authored by: MJCube on Jun 13, '09 12:01:13PM
Nice find! This also works with TextWrangler. To me the method in the hint, saving a variable and setting a color to it, seemed abstruse, so I did it a more hands-on way. It's as simple as one command line, replacing x,y,z with your preferred color in 16-bit RGB:

defaults write com.barebones.textwrangler Color:Invisibles:Spaces -string "rgb(x,y,z)"

I discovered that Color:Invisibles:Other is for control characters and other "gremlins" which show in red (¿) by default, and Color:Invisibles:Spaces is for all the others: space (â—Š) tab (∆) CR (¬) non-breaking space (•) and page break (¶). I left my gremlins as is; the default is rgb(56797,2056,1542).

One way to get 16-bit RGB values (0~65535) is by mousing over the color with Digital Color Meter. If you like your current comment color, you can get its value with
defaults read com.barebones.textwrangler Color:Comment
or just open ~/Library/Preferences/com.barebones.textwrangler.plist and find the value under Color:Comment. I personally like comments in a light grey and invisibles in an even lighter grey.

You can edit .plist files directly in TextWrangler, but if you edit its own plist and delete a key such as Color:Invisibles:Other, it still remembers the value and rewrites it on quitting. So you have to quit TW first, then execute defaults delete com.barebones.textwrangler Color:Invisibles:Other (or use a different text editor).

((Now if only I could find how to hack TW to show a different character for spaces. The diamond ◊ is "noisy" as the User Guide says, and I would much prefer a centered dot (·). I hacked QUED/M to do this ages ago, but haven't found how to do it to TW.))

[ Reply to This | # ]