π @repeat Extensions
Commands to extend the built-in @repeat() mechanism with much more flexible time periods. To work it needs 'append completion date' turned on in Preferences > Todo.
π Repeat Extension plugin
NotePlan has a simple built-in repeat mechanism, which allows for @repeat(1/n)
. That wasn't flexible enough for my purposes, so I wrote this plugin to allow repeats every x days, weeks, months, quarters or years. It does the work of creating the next task using information from completed tasks that include a @repeat(interval)
string and a completed @done(...)
date.
Here are some examples:
Type of repeat | The original line | The result after completing the task and then running /rpt |
---|---|---|
every Monday (starting 2023-07-10) | * task @repeat(1w) >2023-07-10 | * task @repeat(1w) >2023-07-17 (i.e. the next Monday) * [x] task @repeat(1w) >2023-07-10 @done(...) |
1st of the month (starting 2023-08-01) | * do expenses @repeat(1m) >2023-08-01 | * do expenses @repeat(1m) >2023-09-01 (i.e. the next month start) * [x] do expenses @repeat(1m) >2023-08-01 @done(...) |
every 2 weeks | * put out recycling @repeat(2w) | * put out recycling @repeat(2w) >2021-07-15 * [x] put out recycling @repeat(2w) @done(2021-07-01) |
2 months after last done | * top up washer fluid @repeat(+2m) | * top up washer fluid @repeat(+2m) >2023-09-04 * [x] top up washer fluid @repeat(+2m) @done(2023-07-04) |
Compared with the built-in functionality, it also allows you to easily change the text of a repeated task, which otherwise means visiting all the future notes with repeats.
Specifiying the Intervals
The time intervals have two parts: number and then a character. The character is one of:
b
orB
: business days (ignore weekends, but doesn't ignore public holidays, as they're different for each country)d
orD
: daysw
orW
: weeksm
orM
: monthsq
orQ
: quartersy
orY
: years
When the number starts with a + (e.g. +1m
) it will duplicate the task for 1 month after the date the task was completed.
When the number doesn't start with a + (e.g. 1m
) it will duplicate the task for 1 month after the date the task was last due. This is found from a >yyyy-mm-dd
scheduled date. When there is no scheduled date, then for Calendar notes it will duplicate the task for 1 month after the note date, and for Project notes it will duplicate the task for 1 month after the task was completed.
From v0.6 you can specify scheduled dates to all the other calendar note types supported by NotePlan:
- weekly (e.g.
>2023-W28
) - monthly (e.g.
>2023-07
) - quarterly (e.g.
>2023-Q3
) - yearly (e.g.
>2023
)
The resulting repeat lines will also be specified using that same note type, and will write to the appropriate new calendar note (unless it came from a project note, in which case it will stay in the same project note).
Special handling on sync'd tasks (from v0.9.1)
To avoid issues, any sync marker (the blue asterisk) are not carried forward from the completed task to the new version of the task. (But, as expected, both sync'd versions of the original task will show as complete.)
Additionally if a task is sync'd from a regular/project note to a calendar note, the new version of the repeat will always be created in the regular/project note, even if it is completed in the calendar note.
Configuration
For this feature to work, you need to have the 'Append Completion Date' setting turned on in Preferences > Todo, and not to mind the time portion of the @done(...)
tag being removed, as a sign that the line has been processed.
Note: because NotePlan never appends the completion date to completed checklists, this plugin cannot be used to generate repeats from checklists.
There are some settings in the Plugin Settings pane for this plugin:
- 'Delete completed item?', which deletes the completed repeated item (on either done or cancelled tasks).
- Don't look for repeats in Done or Archive note sections? If set, it will not look for repeats in the ## Done or ## Archive sections of notes.
- Run Task Sorter after changes? If set, it will sort the lines in the section after a repeat has been generated in it. The ordering is controlled by the next setting.
- Order for Task Sorting: Comma-separated list of fields to sort by, after generating repeats. This is only used if the 'Run Task Sorter after changes?' setting is set. The choices are any combination of 'content', 'due' (date), 'priority', 'mentions', 'hashtags'. Each field can be preceded by a minus sign to sort in reverse order. This is most useful for '-priority' which will sort from highest to lowest.
Running it Manually
On the currently open note, open the command bar and type the /generate repeats command.
- When run on a Project note, it creates the new repeated task straight before the completed task.
- When run on a Calendar note, it creates the new repeated task on the date of the new repeat. This uses the same calendar note type: so a repeat in a weekly note will go to the appropriate weekly note, etc.
Running it Automatically
The plugin can automatically generate the new repeated task after you complete an existing one. Here's an example (from v0.5) where it will repeat 6 weeks after completion:

This requires adding the following trigger line to the frontmatter at the start of every note you wish to automate in this way:
---
title: <<the note's title on this line, instead of a markdown H1 title>>
triggers: onEditorWillSave => jgclark.RepeatExtensions.onEditorWillSave
---
Tip: This is most easily done by using the /add trigger to note command from my Note Helpers plugin.
Note: because the NotePlan API doesn't fire this trigger when a task is completed from a search result list or from the Reference area. (Please ask the app developer to remove this limitation.) To work around this, I've also created a command in my separate Tidy Up plugin called /Generate @repeats in recent notes. This runs over all recently-changed notes, generating any new @repeats that haven't yet been created. It does not require triggers to be in place.
Support
If you find an issue with this plugin, or would like to suggest new features for it, please raise a Bug or Feature 'Issue'.
If you would like to support my late-night work extending NotePlan through writing these plugins, you can through
Thanks!
Changes
Please see the CHANGELOG.