edit
andappend
give additional ways to update your Taskwarrior tasks.undo
is there for the errors you catch quickly.
I mentioned modify
early on, and it works. But it’s real easy to make silly mistakes. Time to talk about a couple extra commands that reduce the impact of little daily blunders.
modify
So let’s say I got a book for work-related learning. I create a task.
Oh wait, this a learning task, so I should add the +learn
tag. I’ll use modify
to add the forgotten tag.
task ls
shows a condensed report with the most important details of filtered tasks. Very useful for quick summaries and blog posts.
So far so good, right? As long as there’s no confusion about what you’re changing, modify
does the right thing. But a typo? A typo can rewrite your description.
Maybe I’ll add that task to my “WorkSkills” project. What if my fingers forget that the syntax is project:WorkSkills
?
It happens. Frequently. Judge me all you want.
Oops.
Fortunately I caught it quick, so I can fix my mistake with undo
.
undo
task undo
reverts the last change you made, and can keep going back through your history one change at a time.
Taskwarrior tells me what values will be affected by an undo
, which I find helpful. Yes, I want to restore previous state.
Whew. All better.
History is a JSON stream in ~/.task/undo.data
if you’re curious. I don’t really know how far back it goes. I often miss my mistakes until after I made other changes that I’d rather not undo.
append
My typos tend to happen when I’m on a roll. As a result, I don’t notice them until it’s far too late to undo
. I use append
for quick changes to reduce the risk of a typo making the description unrecognizable. It behaves like modify
for adding and changing properties. However, anything interpreted as a description change gets tacked on the end of the current description by append
.
Here’s the same project story as before, but with append
instead of modify
.
I still made my mistake, but at least I can find the task by its original description.
NOTE
prepend
also exists, and is useful much the same way append is. Which you use is a matter of preference.
But what about bigger changes? Or what about when I change the description and don’t notice until a couple weeks later?
edit
The edit
command loads the task details into a template, which it sends off to your $EDITOR
. Once written, Taskwarrior updates the task to reflect changes.
Those ✘
characters are just how I show trailing whitespace in Vim with listchars. Anyways, I added “WorkSkills” to the “Project” line and fixed the description. There is even a line where I can add an annotation if I want, but not today. As soon as I save the file and quit my editor, Taskwarrior applies my changes.
See?
I feel better now. I’ve been wanting to mention these commands in the series for a while now. Since February 2018, according to my task list.
Backlinks
Got a comment? A question? More of a comment than a question?
Talk to me about this page on: mastodon
Added to vault 2024-01-15. Updated on 2024-02-01