Skip to content
Brett Terpstra edited this page Nov 20, 2021 · 3 revisions

Several commands modify existing entries, marking them complete with a timestamp, adding and removing tags, and adding notes.

finish      - Mark last X entries as @done
cancel      - Mark last X entries as @done without completion date
tag         - Tag last entry
mark, flag  - Mark last entry as flagged
note        - Add a note to the last entry
select      - Display an interactive menu to perform operations

Finishing

doing finish by itself is the same as doing done by itself. It adds @done(timestamp) to the last entry. It also accepts a numeric argument to complete X number of tasks back in history (0 affects all entries). Add -a to also archive the affected entries.

doing finish also provides an --auto flag, which you can use to set the end time of any entry to 1 minute before the start time of the next. Running a command such as doing finish --auto 10 will go through the last 10 entries and sequentially update any without a @done tag with one set to the time just before the next entry in the list.

As mentioned above, finish also accepts --back "2 hours" (sets the finish date from time now minus interval) or --took 30m (sets the finish date to time started plus interval) so you can accurately add times to completed tasks, even if you don't do it in the moment.

Both done and finish accept an --archive switch which immediately moves the completed entries to the Archive section with a @from(Project) tag.

You can finish the last entry containing a specific tag or combination of tags using the --tag flag. Multiple tags are separated by commas. By default tags are combined with an AND boolean, meaning the entry must contain all specified tags to be considered. For example, to finish the last entry containing both "@work" and "@project1", you would use:

doing finish --tag=work,project1

You can change the boolean using --bool=OR (last entry containing any of the specified tags) or --bool=NOT (last entry containing none of the tags).

You can also include a --no-date switch to add @done without a finish date, meaning no time is tracked for the task. doing cancel is an alias for this. Like finish, cancel accepts a count to act on the last X entries, as well as --archive and --section options. cancel also accepts the --tag and --bool flags for tag filtering.

(See the never_time config option in Time Tracking if you want to always avoid adding a date to items in specific sections or with certain tags.)

By default doing finish works on a single entry, the last entry or the most recent entry matching a --tag or --search query. Specifying doing finish 10 would finish any unfinished entries within the last 10 entries. In the case of --tag or --search queries, the count serves as the maximum number of matches doing will act on, sorted in reverse date order (most recent first). A count of 0 will disable the limit entirely, acting on all matching entries.

Both finish and cancel accept --unfinished as an argument. This causes them to act on the last entry not already marked @done, no matter how far back it's dated or how many @done entries come after it. You can use doing finish --unfinished X -s SECTION to finish the last X unfinished entries in SECTION.

Tagging

See Tagging for more info on tags.

See Autotagging to learn how to add tags automatically based on keywords.

Modifying the last entry

If you want to make a change to the last entry added, use doing last -e. The -e flag opens the last entry (including note) in your $EDITOR, and when you close your editor, your doing file will be updated with any changes you made to the entry.

You can choose the last entry in a specific section by including the -s flag, so doing last -s Later -e would edit the most recent entry in the Later section.

You can also use text search or a tag filter to get an entry earlier than the most recent one. A tag search with doing last --tag=project1 -e will edit the last entry tagged @project1. Multiple tags can be combined with commas, and you can use --bool to specify whether the search is AND (matches all tags given), OR (matches any tag given), or NOT (matches none of the tags).

You can edit the last entry that matches a search string with --search=QUERY. QUERY can either be a raw string, or you can surround it with slashes to search by regex (doing last --search="/project./" -e). If the string is raw text, fuzzy matching will be used, so the characters must be in order but can be separated by up to three other characters.

Both --tag and --search can be constrained to a single section with -s SECTION.

Editing entries

Many other commands, including now, done, later, and again/resume, have an --editor (-e) switch. When this is used, the affected entry is loaded in the editor defined in your $EDITOR variable. You can modify the entry (or entries) and notes in any way you like and the results will be used to update the affected entry in the doing file.

When there are multiple notes being edited, divider comment lines will be included. Edit anything you want in the entries, but do not remove the divider lines. When the resulting text is processed, if there doesn't appear to be the same number of entries in the edited version, your changes will be discarded.

Batch modifying entries

See Batch Editing.