Taskwarrior: How to reference last edited/added task?

Created on 22 Jun 2020  路  3Comments  路  Source: GothenburgBitFactory/taskwarrior

I find myself using the annotate feature on many tasks. For example, "read blah blah's article about chickens" and immediately doing "task annotate "'url to thing i am to read'". I also will regularly forget a label or a due date or whatnot.

I think it would be great if an "unspecific" (im not sure of the term) modification to a task would assume the most recently created (or even, "operated on" but that might get into trouble). For example,

$ task add +personal "read blah blah" 
Created task 290
$ task 290 annotate "url-to-read" 

would become

$ task add +personal "read blah blah" 
Created task 290
$ task annotate "url-to-read" 

Perhaps I am unusual, but there is rarely a time where I want to modify every task and I would much rather go find the special keyword for that. As a result, the default for "no search/unspecific" command operating on last task edited/added seems more useful.

PS: also, if this is "asked and answered" I apologize, I couldn't think of good keywords to search for in the issue list.

question

All 3 comments

The latest created task has the virtual keyword "LATEST".

blabla:~$ task add test latest
Created task 66.
blabla:~$ task +LATEST
[task next ( +LATEST )]

ID Age Description Urg
65 5s  test latest    0

1 task
blabla:~$

You could even set up a bash alias or a taskwarrior alias to avoid typing the "hard" to reach '+'.

Thanks for providing the tips guys!

Was this page helpful?
0 / 5 - 0 ratings