Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add custom notations? #16

Closed
jarmitage opened this issue Jul 2, 2016 · 11 comments
Closed

How to add custom notations? #16

jarmitage opened this issue Jul 2, 2016 · 11 comments

Comments

@jarmitage
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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

@jarmitage
Copy link
Author

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

@dertuxmalwieder
Copy link
Owner

I mean I can't highlight freeform entries.

@jarmitage
Copy link
Author

jarmitage commented Jul 4, 2016

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants