[TxMt] scope-specific word completion collection

Oliver Taylor oliver at ollieman.net
Sat Dec 17 12:28:44 UTC 2005


>> [...] 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.


> (I assumed the four tabs needs to be at the begin of the line):

yes, correct.


> {   completionCommand = 'perl -pe "s/^\t{4}($TM_CURRENT_WORD.*)\$|.* 
> \n?/\$1/" <"$TM_FILEPATH"';
>     disableDefaultCompletion = 1;
> }

this is exactly what I'm looking for. but... it doesn't seem to be  
working, in fact, it seems to be *excluding* everything in the  
splay.character scope. Any ideas?

> (the completion command ought to get the entire document as stdin,  
> but it currently doesn't).

bummer.



More information about the textmate mailing list