I'm creating a custom bundle for screenwriting and I've got most of it down, but I want to leverage textmate's completion abilities. For example, I've got this is the language:


{ name = 'splay.character';

match = '\t\t\t\t+(.*)';

},


...to define anything that starts with 4 tabs as "splay.character"


Now, I want to collect all the words in the current document (but only within the "splay.character" scope, and use them as a list for auto-completion. So that when I tab 4 times and type "Ki" then escape, "King John" will pop up.


I know this is done with a shell command (right?) but I have no idea how to do this.