[TxMt] Adding new TODO scope across languages?

Dan Sandler dsandler at dsandler.org
Sun Oct 22 06:26:47 UTC 2006


As a recovering vimaholic, I miss special highlighting of (FIXME|TODO| 
XXX) in my source.  (I realize that I can get a list of TODOs with C- 
S-t, but it's nice to have things like "XXX: broken" or "FIXME  
dsandler:" leap out at me as I'm skimming code.)

I seem to be able to hack these rules into individual languages; for  
example, in Python, I changed the comment.line.number-sign.py pattern  
thusly:

		{	name = 'comment.line.number-sign.py';
			begin = '#';
			end = '$';
			patterns = (
				{	name = 'todo.todo';
					match = '(TODO)( \S*:|:?)';
				},
				{	name = 'todo.fixme';
					match = '(FIXME)( \S*:|:?)';
				},
				{	name = 'todo.xxx';
					match = '(XXX)( \S*:|:?)';
				},
				{	name = 'todo.changed';
					match = '(CHANGED)( \S*:|:?)';
				},
			);
		},

(This seemed to require changing Python's line-comment pattern from a  
'match' to a begin/end kind of thing.)

With these scopes, you can now set all TODOs to a given color, or  
pick different colors for each, etc. (perhaps matching the colors up  
with those in the "Show TODO List" command).

So, is there any way to apply this kind of new scope to to (comments  
in) all languages at once, or do I (or the TextMate BDFL) have to go  
and integrate it into each one by hand?

Thanks,
--ds



More information about the textmate mailing list