Screenshot / Code Snippet
To use, type an "@" then start typing a few characters of the user's name. Then hit Ctrl+Space. The script will then search for usernames that match what you've entered so far. If there is exactly one match, it will autocomplete to "@username: ". If there is more than one match, it will autocomplete to the longest common substring of those entries matching what you've entered. For example, if you typed "@j", and both "Jeff Atwood" and "Jeff Probst" are active, it would autocomplete to "@Jeff".
The usernames that will be searched for autocompletion consist of:
- The person who asked this question.
- The person who provided this answer (if you are commenting on an answer).
- Anyone who has left a comment in the same comment thread you are writing your comment for.
Those of us without fancy foreign keyboards can type "
@ol" to get Ólafur Waage, or "
@a" or "
@ae" to get Æther. You can also still type the foreign characters if you know how. Of course, the name has to use characters that look kind of like English characters. (Sorry, ベレアー アダム.)
There is a variable called
suffix in the code. It is defaulted to
': '. This suffix will be appended after a complete match. Some people don't like the colon; if you're one of those people, just change the suffix to a space (or whatever you want it to be).
Tested on Firefox 4.0 and Chrome 10.0, on Windows 7. Requires Greasemonkey on Firefox.
Do whatever you want, as long as you don't sell it or claim you wrote it. If you make any cool modifications, let me know!