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

autosuggestion #6

Closed
uGeek opened this issue Oct 16, 2021 · 8 comments
Closed

autosuggestion #6

uGeek opened this issue Oct 16, 2021 · 8 comments
Labels
enhancement New feature or request

Comments

@uGeek
Copy link

uGeek commented Oct 16, 2021

It would be possible that when you write +, @, due: ... all the options to be selected appear, to register tasks faster and not make mistakes when writing them.

Very good application. I like very much

Thank you

@vonshednob
Copy link
Owner

Oh yeah, I absolutely agree! Currently there’s a bigger refactoring on-going which will make this easier.
So, it’ll happen, but not very soon.

Not quite sure about the due: completion though; since it’s very dynamic what you could write there (2022-02-02, +4d, tue, +1y2w-2d) it would almost require a calendar selection, but even that wouldn’t quite cut it.
Any ideas?

@vonshednob vonshednob added the enhancement New feature or request label Oct 17, 2021
@maxigaz
Copy link

maxigaz commented Oct 17, 2021

One is idea is to make an option to specify the date format, and use it as the basis of converting to/from.

In khal, for example, you can set the format for both the short date and the long date. I have the following in my ~/.config/khal/config:

[locale]
timeformat = %H:%M
dateformat = %m.%d.
longdateformat = %Y-%m-%d
datetimeformat = %Y-%m-%d %H:%M
longdatetimeformat = %Y-%m-%d %H:%M

So, maybe pter could detect that if I started writing due:2021 and I have %Y-%m-%d configured as the format, so pressing tab could complete the date as due:2021-10-17.

@vonshednob
Copy link
Owner

Not quite sure how it would complete the date though, if I only type due:2021 and Tab… would it show a completion option for month and day?

Just curious: are you using absolute dates in due: and t: more often than relative dates? I keep finding myself rather settings tasks up to be at due:sat or due:+1w.

@maxigaz
Copy link

maxigaz commented Oct 18, 2021

if I only type due:2021 and Tab… would it show a completion option for month and day?

Actually, I was only thinking of completing the current date, but I understand that not everyone would find it adequate.

So, another option would be to print out the current date in a specified format (such as %Y-%m-%d), and create highlighted tab stops for each number (so pressing tab highlights the month, pressing it again highlights the day etc.), which could be increased/decreased with the arrow keys or overwritten if a number was pressed.

Just curious: are you using absolute dates in due: and t: more often than relative dates? I keep finding myself rather settings tasks up to be at due:sat or due:+1w.

Yes, I prefer absolute dates. I think the main reason is that they are easier to be parsed by scripts. (I have a Polybar script that notifies me if I have tasks due today.)

@vonshednob
Copy link
Owner

Ah, that was maybe a misunderstanding. I gotta check the documentation whether it's not clear enough.

When editing tasks, you can enter a relative date, for example, due:0 (meaning: due in +0 days, i.e. today), but the todo.txt standard does not actually allow for relative dates. Instead pter will save the date as an absolute date!

So, if I add a task in pter today, like Add autocompletion to contexts in +pter due:+1w, pter will expand the due: tag to due:2021-10-25 -- i.e. 1 week (7 days) from now.

Have a look at the section on relative dates in the documentation!

Would this alleviate the need to have autocompletion for the t: and due: tags?

Obviously the + and @ fields need autocompletion though.

@maxigaz
Copy link

maxigaz commented Oct 19, 2021

When editing tasks, you can enter a relative date, for example, due:0 (meaning: due in +0 days, i.e. today), but the todo.txt standard does not actually allow for relative dates. Instead pter will save the date as an absolute date!

So, if I add a task in pter today, like Add autocompletion to contexts in +pter due:+1w, pter will expand the due: tag to due:2021-10-25 -- i.e. 1 week (7 days) from now.

Have a look at the section on relative dates in the documentation!

Oh, I didn't know pter has this feature. Very useful! (And I'll keep reading the documentation. :))

Would this alleviate the need to have autocompletion for the t: and due: tags?

Yes, absolutely! (As far as I'm concerned.)

@vonshednob
Copy link
Owner

Autocompletion is implemented in 2.1.0.

I was a bit too eager to push it out of the door, so the documentation is not great (i.e. missing). It’ll come later.

For now: Tab, ^N, and arrow key down will select the next available option, ^P, and arrow key up will select the previous option. Enter is used to select the completion option, Esc and ^C will close the completion box.

Completion works for contexts (@) and projects (+).

@maxigaz
Copy link

maxigaz commented Nov 8, 2021

Thank you very much!

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

No branches or pull requests

3 participants