MH Daily Habits

unlisted

by MH - Matheus Heidemann

Manage daily habits in Obsidian with periodic tracking, charts, reminders, backups, exports, and note frontmatter mode.

Updated 2mo ago
View on GitHub

MH Daily Habits

Summary

MH Daily Habits is an Obsidian plugin for tracking habits across daily, weekly, monthly, quarterly, and annual periods. It supports check-off and numeric habits, schedule rules, charts, reminders, backups, CSV export, and an optional note frontmatter mode.

Purpose And Features

The plugin is built for managing recurring habits directly inside an Obsidian vault.

  • Track boolean habits, such as Journal, and numeric habits, such as Read 30 minutes.
  • Use periodicities: daily, weekly, monthly, quarterly, and annual.
  • Configure schedules per habit: specific weekdays, days of month, dates of year, week numbers, months, or quarters.
  • View habits in columns or period tabs.
  • Render charts: completion heatmaps, streaks, and habit trend line charts.
  • Show reminders for pending habits at configured times.
  • Export habit data to CSV.
  • Create and restore backups.
  • Use standard JSON storage or note frontmatter storage.
  • Embed habit views in notes with the mh-daily-habits code block.

How It Works / How To Use

Open the MH Daily Habits view from the ribbon icon or the Daily Habits command. Add habits from the plugin settings, then mark them complete or increment/decrement numeric progress from the view.

Habit configuration supports:

  • Name: display label.
  • Icon and Icon color: visual identity for the habit.
  • Type: Check-off or Numeric.
  • Unit, Target, and Step: numeric habit options.
  • Periodicity: daily, weekly, monthly, quarterly, or annual.
  • Schedule: limits when the habit is active.
  • Created Date: excludes dates before the habit existed.
  • Deactivated Since: keeps history while hiding future occurrences.
  • Property Name: frontmatter key used in note mode.

Schedule examples:

  • Daily weekdays: mon,wed,fri
  • Daily month days: 1,15 or 1-5,20
  • Daily year dates: 01-01,25-12 or 01-01..31-03
  • Weekly week numbers: 1,3,5 or 1-10,20
  • Monthly months: 1,3,5 or 1-6,12
  • Quarterly quarters: 1,3 or 1-2

In standard mode, habit data is stored in generated JSON files under habits-data/. In developer mode, test data is isolated under habits-dev-data/.

In note mode, the plugin reads and writes habit values to periodic note frontmatter. Each habit needs a Property Name. Boolean habits use a boolean frontmatter value, and numeric habits use a number. Manual note paths support filename tokens such as YYYY, MM, DD, WW, and QQ.

Frontmatter example:

drink-water: true
steps: 10000
read-minutes: 30

Embedded view example:

```mh-daily-habits
view: columns
date: today
periods: daily,weekly
habits-per-row: 1
show-progress-bar: true
interactive: true
```

Code block options:

  • view: columns or tabs.
  • columns-per-row: 0 for auto, or a number.
  • show-all-periods: true or false.
  • habits-per-row: number of habit cards per row.
  • show-progress-bar: true or false.
  • periods: comma-separated period list.
  • habits: comma-separated habit IDs or labels.
  • date: today or YYYY-MM-DD.
  • show-header: true or false.
  • compact: true or false.
  • gap: spacing in pixels.
  • interactive: true or false.
  • show-hidden: true or false.

The settings tab includes language, storage mode, first day of week, enabled periods, habit management, layout, date formats, note mode, reminders, backups, export location, and developer mode.

Installation

Copy these files into your vault plugin folder at .obsidian/plugins/mh-daily-habits/:

  • main.js
  • manifest.json
  • versions.json
  • locales/en-us.json
  • locales/pt-br.json

Enable MH Daily Habits from Obsidian community plugin settings. The plugin requires Obsidian 1.12.7 or newer.

Development

Install dependencies:

npm install

Run a development build watcher:

npm run dev

Run TypeScript validation:

npm run typecheck

Build the production bundle:

npm run build

The source code lives in src/. The build entrypoint is src/main.ts, and the generated Obsidian bundle is main.js. Do not edit main.js manually.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.