每周重复任务emacs组织模式。

时间:2022-03-18 14:36:03

I want to track habits using org-mode. For example, I want to do exercise 3 times every week. Is there a way to schedule 3 times a task every week irrespective of the date in org-mode?

我想用组织模式来追踪习惯。例如,我想每周锻炼三次。是否有办法每周安排3次任务,而不考虑组织模式的日期?

3 个解决方案

#1


24  

You should be able to more or less do that using org habit tracking (See: Org-Habits).

您应该能够或多或少地使用org习惯跟踪(参见:org - habits)。

To load org-habits you would need to add it to org-modules

要加载组织习惯,您需要将其添加到org-modules中。

(add-to-list 'org-modules "org-habit")

Then:

然后:

  1. Use C-c C-s to set SCHEDULED.
  2. 使用C-c -s来设定排定时间。
  3. Use C-c C-t to set your exercise TODO.
  4. 使用C-c -t来设置你的练习。
  5. Use C-c C-x p to have the STYLE Property habit (add in any other properties as desired as well).
  6. 使用C-c C-x p来拥有风格属性的习惯(还可以添加任何其他属性)。

Now the lines like this should have be appended after the title:

现在,像这样的线应该在标题后面加上:

:PROPERTIES:
:STYLE: habit
:END:

A single habit should suffice, it will not be exactly 3 times per week, but over time it will average out to such. If you use a scheduled repeater that is .+2d/3d you will be prompted to perform the habit no more often than every second day, and no less often than every 3. (This averages out to 2.9 times per week if you continue it long enough. Over 6 weeks (42 days) you would complete it at least 14 times, at most 21, or 17.5 on average. 18 times in 6 weeks would be 3x per week).

一个单一的习惯就足够了,它不会是每周3次,但随着时间的推移,它会变得平均起来。如果你使用的是一个定时的中继器,那么你将会被提示去执行这个习惯,而不是每隔两天,而且次数也不会少于每3次。(如果你持续的时间足够长的话,每周的平均时间是2.9次。)超过6周(42天),你会至少完成14次,最多21次,平均17.5次。6周的18次是每周3次。

Your final habit should look something like this initially, as you complete it DONE logging will be added in and the last-repeat will be kept track of as a property:

你的最终习惯应该是这样开始的,当你完成它的时候,记录将被添加进来,最后的重复将被记录为一个属性:

** TODO Exercise
SCHEDULED: <2012-01-06 Fri .+2d/3d>
:PROPERTIES:
:STYLE: habit
:END:

Note: If you get the error Symbol's value as variable is void: org-modules when trying to load the org-habit module, you might want to try the following instead:

注意:如果您将错误符号的值作为变量的值为void:当试图加载org-habit模块时,您可能想尝试以下方法:

(require 'org)
(require 'org-install)
(add-to-list 'org-modules "org-habit")

#2


0  

You can use a timestamp with repeater interval as described in the manual.

可以使用手册中描述的中继器间隔使用时间戳。

 A timestamp may contain a _repeater interval_, indicating that it
 applies not only on the given date, but again and again after a
 certain interval of N days (d), weeks (w), months (m), or years
 (y).  The following will show up in the agenda every Wednesday:

      * Pick up Sam at school <2007-05-16 Wed 12:30 +1w>

#3


0  

I can't see any way to do this with one entry. The way I do similar things is to create a special TODO sequence for is, say (sequence ('HABIT' '|' 'CHECK')) with setq org-todo-keywords

我看不出有什么办法能做到这一点。我做类似事情的方法是为is创建一个特殊的TODO序列,比如setq org- TODO关键字(“习惯”'|' 'CHECK')。

Then simply write three entries, each on a week repeat

然后简单地写三个条目,每一个重复一个星期。

* HABIT Monday workout
  DEADLINE: <2012-01-09 Mon +1w>
* HABIT Wednessday workout
  DEADLINE: <2012-01-11 Wed +1w>
* HABIT Friday workout
  DEADLINE: <2012-01-06 Fri +1w>

It's not that clean, but it works.

不是很干净,但是很有效。

#1


24  

You should be able to more or less do that using org habit tracking (See: Org-Habits).

您应该能够或多或少地使用org习惯跟踪(参见:org - habits)。

To load org-habits you would need to add it to org-modules

要加载组织习惯,您需要将其添加到org-modules中。

(add-to-list 'org-modules "org-habit")

Then:

然后:

  1. Use C-c C-s to set SCHEDULED.
  2. 使用C-c -s来设定排定时间。
  3. Use C-c C-t to set your exercise TODO.
  4. 使用C-c -t来设置你的练习。
  5. Use C-c C-x p to have the STYLE Property habit (add in any other properties as desired as well).
  6. 使用C-c C-x p来拥有风格属性的习惯(还可以添加任何其他属性)。

Now the lines like this should have be appended after the title:

现在,像这样的线应该在标题后面加上:

:PROPERTIES:
:STYLE: habit
:END:

A single habit should suffice, it will not be exactly 3 times per week, but over time it will average out to such. If you use a scheduled repeater that is .+2d/3d you will be prompted to perform the habit no more often than every second day, and no less often than every 3. (This averages out to 2.9 times per week if you continue it long enough. Over 6 weeks (42 days) you would complete it at least 14 times, at most 21, or 17.5 on average. 18 times in 6 weeks would be 3x per week).

一个单一的习惯就足够了,它不会是每周3次,但随着时间的推移,它会变得平均起来。如果你使用的是一个定时的中继器,那么你将会被提示去执行这个习惯,而不是每隔两天,而且次数也不会少于每3次。(如果你持续的时间足够长的话,每周的平均时间是2.9次。)超过6周(42天),你会至少完成14次,最多21次,平均17.5次。6周的18次是每周3次。

Your final habit should look something like this initially, as you complete it DONE logging will be added in and the last-repeat will be kept track of as a property:

你的最终习惯应该是这样开始的,当你完成它的时候,记录将被添加进来,最后的重复将被记录为一个属性:

** TODO Exercise
SCHEDULED: <2012-01-06 Fri .+2d/3d>
:PROPERTIES:
:STYLE: habit
:END:

Note: If you get the error Symbol's value as variable is void: org-modules when trying to load the org-habit module, you might want to try the following instead:

注意:如果您将错误符号的值作为变量的值为void:当试图加载org-habit模块时,您可能想尝试以下方法:

(require 'org)
(require 'org-install)
(add-to-list 'org-modules "org-habit")

#2


0  

You can use a timestamp with repeater interval as described in the manual.

可以使用手册中描述的中继器间隔使用时间戳。

 A timestamp may contain a _repeater interval_, indicating that it
 applies not only on the given date, but again and again after a
 certain interval of N days (d), weeks (w), months (m), or years
 (y).  The following will show up in the agenda every Wednesday:

      * Pick up Sam at school <2007-05-16 Wed 12:30 +1w>

#3


0  

I can't see any way to do this with one entry. The way I do similar things is to create a special TODO sequence for is, say (sequence ('HABIT' '|' 'CHECK')) with setq org-todo-keywords

我看不出有什么办法能做到这一点。我做类似事情的方法是为is创建一个特殊的TODO序列,比如setq org- TODO关键字(“习惯”'|' 'CHECK')。

Then simply write three entries, each on a week repeat

然后简单地写三个条目,每一个重复一个星期。

* HABIT Monday workout
  DEADLINE: <2012-01-09 Mon +1w>
* HABIT Wednessday workout
  DEADLINE: <2012-01-11 Wed +1w>
* HABIT Friday workout
  DEADLINE: <2012-01-06 Fri +1w>

It's not that clean, but it works.

不是很干净,但是很有效。