SublimeTODO icon indicating copy to clipboard operation
SublimeTODO copied to clipboard

Support for TODO Priority

Open imperez opened this issue 12 years ago • 3 comments

I was thinking it would be good to have some sort of support for priority in TODOs. I was thinking when you write a TODO you do something like this:

TODO: (HIGH) This is a very important todo

TODO: (HIGH) This is another very important todo

TODO: (LOW) This is a not so important todo

Then when you list your TODOs the list would be organized with priority in mind.

TODO (3)

HIGH

  1. This is a very important todo
  2. This is a very important todo

LOW

  1. This is a not so important todo

It would help give more of an idea of what TODO should be focused on more especially as the file gets large.

imperez avatar Feb 18 '12 17:02 imperez

I think you can put

"patterns":
{
    "TODO(HIGH)": "TODO\\(HIGH\\)[\\s]*?:+(?P<todohigh>.*)$",
    "TODO(LOW)": "TODO\\(LOW\\)[\\s]*?:+(?P<todolow>.*)$"
}

Into the Preferences.sublime-settings file.

In this sense you can have

# TODO(HIGH): This is a very important todo
# TODO(HIGH): This is another very important todo
# TODO(LOW): This is a not so important todo

And it will yield

## TODOHIGH (1)
1. This is a very important todo
2. This is another very important todo

## TODOLOW (1)
1. This is a not so important todo

Not exactly the pattern you want but as the pattern you require is overlapping with the original TODO pattern, I cannot overwrite it.

( However I am not using them because typing (HIGH) and (LOW) is too much typing for me. I would rather use the pattern "TODO\\![\\s]*?:+(?P<todoimportant>.*)$", which response to #TODO!: this is an important task. I am just lazy :P )

robcowie: Would it be possible to move the "core task" in your python file to the sublime settings file? So people can totally redefine all tasks without modifying your python code?

erinata avatar Mar 24 '12 23:03 erinata

Great idea. I'll use that method since it does work as a good compromise. Thanks!

imperez avatar Mar 25 '12 00:03 imperez

I would really love this feature too

Jamesking56 avatar Mar 05 '13 12:03 Jamesking56