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
Dan Sandler wrote:
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:
[...]
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?
No, but in TM 2.0, we'll have scope injection, which will allow this sort of thing (and much more). In the mean time, however, if you want such changes, you'll just have to do it on your local copies of the grammars, and once for each language, sadly.
-Jacob