My solution, which I think I saw somewhere else several years ago, was to change the text color of the sensitive parts of the file to white and delimit it with something obvious. For example, I might have an entry like the following in this document:
Server username/password: . Bob ./. $w0rdf1sh .
By changing the colors of the text for the username and password to white (or whatever the background color of the document it, but that'll almost always be white), the text between the periods for each field becomes invisible. To see it all I have to do is highlight it, which allows for selective viewing of just the part(s) of the document I want to see.
In TextEdit this is easy with the 'Show Colors' menu option in the 'Format » Text' submenu, which is easily accessed with the Cmd-Shift-C keyboard shortcut. Just highlight the text you want to obscure, possibly by using the Command key to select discontinuous pieces of text, then set the text color to white. The delimiters (I use periods) indicate where the hidden text is, and I add some arbitrary white space around passwords so that the size of the space between the delimiters isn't a clue as to how long the password might be. This is certainly not a substitute for secure storage of information, but it can help reduce the likelihood of an over-the-shoulder type of information leak.
[crarko adds: I tested this, and it works as described.]

