3
votes

I use org-habit to keep track of some of my recurring tasks in org-mode.

By default the habits show up in my agenda view (along with their progress graph) if they are scheduled for the current day. Once I mark a habit task as done, it disappears from the agenda view.

Sometimes I want to see how I'm doing with my all my habits. What I want to see is an agenda view that shows all tasks that are habits (along with their progress graph) and only those tasks (i.e. tasks that aren't habits should be excluded).

How do I construct such an agenda view?

I know I can use org-habit-show-habits-only-for-today to show all habits in the agenda, even if they aren't scheduled today. However, I can't figure out how to exclude those tasks that aren't habits.

2

2 Answers

2
votes

An item is a habit if and only if the STYLE property is set to habit. You can search for this using the built-in agenda search (C-c a s) and searching for STYLE="habit".

0
votes

To exclude non-habits from daily agenda view you can set org-agenda-skip-function variable in your custom agenda view definition (org-agenda-custom-commands) as:

(org-agenda-skip-function
 (lambda ()
   (unless (string-equal (org-entry-get (point) "style") "habit")
     (outline-next-heading))))