dertuxmalwieder / SublimeTodoTxt

Sublime Text syntax highlighting for Todo.txt
125 stars 19 forks source link

How to add custom notations? #16

Closed jarmitage closed 4 years ago

jarmitage commented 8 years ago

Hey thanks for this useful package

Is there a way to add custom 'notations', which would be highlighted like WAIT and due:yyyy-mm-dd are?

As in https://github.com/ginatrapani/todo.txt-cli/wiki/The-Todo.txt-Format#other-notations

Thanks!

dertuxmalwieder commented 8 years ago

No problem - and: not really, because I like to keep close to "the standard" as in "everything but the undefined states". The problem would probably be to recognize them correctly, given that there is no format definition.

jarmitage commented 8 years ago

Yeah, that's understandable.

I was just looking at where WAIT is defined in your plugin, and was wondering how I would go about adding an extra dictionary entry – presumably that would achieve what I'm aiming for, right?

I'm happy to do that manually if so and let you keep your unconfigurationalised setup :-)

dertuxmalwieder commented 8 years ago

For such a dictionary entry, it would be required to actually have a format definition...

jarmitage commented 8 years ago

You mean it would also need to be defined in Todo.sh?

dertuxmalwieder commented 8 years ago

I mean I can't highlight freeform entries.

jarmitage commented 8 years ago

Sorry I'm a bit confused. Would this not work?

<dict>
<key>comment</key>
<string>Todo COLLECT command</string>
<key>match</key>
<string>[^\S](?i:COLLECT)[^\S]</string>
<key>name</key>
<string>keyword.other.todotxt.collect</string>
</dict>
dertuxmalwieder commented 8 years ago

Probably it would, but the website you linked states:

you can choose any unique keyword, and search by it.

Any keyword means "I can't just add this keyword".

jarmitage commented 8 years ago

Ok sure. It doesn't sound like you are interested in doing this, but it seems possible that the plugin could detect any ALL CAPS words (some Todo.txt apps use WORD: instead of WORD to avoid confusion) and apply highlighting, or maintain a custom dictionary.

Anyway I can implement this if I need it. Thanks for your help!

dertuxmalwieder commented 8 years ago

I think we're just not getting each other's point. I would be interested if I could. :-) The problem is that the specification doesn't even say it has to be a CAPS word.

jarmitage commented 8 years ago

Ah yeah you're right, I forgot about that!

Well, my main inspiration for raising this was the Todour app. See how in the video the user can add a term like LATER: which will be recognised.

dertuxmalwieder commented 8 years ago

Here's my suggestion: One of us asks the Todo.txt designer whether caps are mandatory. If so, I'll add it. :-)