create an emacs config that uses habbit tracker to track trainingdays
- User
create an emacs config that uses habbit tracker to track trainingdays
- Assistant
Here's an example of an Emacs config that uses
habitica.elpackage to track training days:- Install
habitica.elpackage:
(use-package habitica :ensure t)- Add the following to your config file (e.g.,
.emacsorinit.el):
;; Set up Habitica API credentials (setq habitica-api-user "YOUR_USER_ID") (setq habitica-api-key "YOUR_API_KEY") ;; Function to log training days (defun log-training-day () "Log a training day in Habitica." (interactive) (habitica-create-task "Training Day")) ;; Set keybinding for logging training days (global-set-key (kbd "C-c t") 'log-training-day)Replace
"YOUR_USER_ID"and"YOUR_API_KEY"with your actual Habitica API credentials. You can find these credentials in your Habitica account settings.- Restart Emacs or reload your config file.
Now, whenever you want to log a training day, you can press
C-c t(or whichever keybinding you set) and it will create a task named "Training Day" in your Habitica account.Remember to mark the training days as completed in Habitica to track your progress accurately.
- Install
- User
write a emacs config that uses org-mode and habit tracker to log cleaning day
- Assistant
Sure! Here's an example of an Emacs config that uses
org-modeandhabitica.elpackage to log cleaning days:- Install
org-modeandhabitica.elpackages:
(use-package org :ensure t) (use-package habitica :ensure t)- Add the following to your config file (e.g.,
.emacsorinit.el):
;; Set up Habitica API credentials (setq habitica-api-user "YOUR_USER_ID") (setq habitica-api-key "YOUR_API_KEY") ;; Set up org-mode for capturing cleaning tasks (setq org-default-notes-file "~/path/to/your/notes.org") ;; Define cleaning template for org-capture (setq org-capture-templates '(("c" "Cleaning Day" entry (file+headline org-default-notes-file "Cleaning") "* TODO Cleaning %?\n SCHEDULED: <%<%Y-%m-%d %a>>"))) ;; Function to log cleaning day (defun log-cleaning-day () "Log a cleaning day in Habitica and org-mode." (interactive) (org-capture nil "c") (habitica-create-task "Cleaning Day")) ;; Set keybinding for logging cleaning days (global-set-key (kbd "C-c c") 'log-cleaning-day) - Install
- User
write an emacs config that uses habit tracker
- Assistant
Certainly! Here's an example of an Emacs config that uses the
habitica.elpackage to track habits:- Install
habitica.elpackage:
(use-package habitica :ensure t)- Add the following to your config file (e.g.,
.emacsorinit.el):
;; Set up Habitica API credentials (setq habitica-api-user "YOUR_USER_ID") (setq habitica-api-key "YOUR_API_KEY") ;; Function to log a completed habit (defun log-habit (habit-id) "Log a completed habit in Habitica." (interactive "sHabit ID: ") (habitica-log-habit habit-id)) ;; Function to increment a habit streak (defun increment-habit-streak (habit-id) "Increment the streak of a habit in Habitica." (interactive "sHabit ID: ") (habitica-increment-habit-streak habit-id)) ;; Set keybindings for logging habits and incrementing streaks (global-set-key (kbd "C-c l") 'log-habit) (global-set-key (kbd "C-c i") 'increment-habit-streak) - Install
- User
write an emacs config that uses org-habit
- Assistant
Certainly! Emacs has a built-in package called
org-habitthat provides support for tracking habits withinorg-mode. Here's an example of an Emacs config that usesorg-habitto track habits:- Add the following to your config file (e.g.,
.emacsorinit.el):
;; Load org and org-habit (require 'org) (require 'org-habit) ;; Set up org-habit properties (setq org-habit-show-habits-only-for-today nil) (setq org-habit-graph-column 80) ;; Set up org-habit agenda display (setq org-agenda-custom-commands '(("H" "Habits" ((tags "STYLE=\"habit\"" ((org-agenda-overriding-header "Habits") (org-agenda-sorting-strategy '(todo-state-up)))) (agenda ""))))) ;; Define custom org-habit keywords (setq org-todo-keywords '((sequence "TODO" "WAITING" "|" "DONE" "CANCELLED") (sequence "HABIT(!)" "ROUTINE(!)"))) ;; Set keybinding for org-habit-toggle-habits (global-set-key (kbd "C-c C-x x") 'org-habit-toggle-habits) - Add the following to your config file (e.g.,
- User
write an emacs config that uses org-habit and show green colour when on track in agenda
- Assistant
Sure! Here's an example of an Emacs config that uses
org-habit, and highlights habits in green when they are on track in the agenda:- Add the following to your config file (e.g.,
.emacsorinit.el):
;; Load org and org-habit (require 'org) (require 'org-habit) ;; Set up org-habit properties (setq org-habit-show-habits-only-for-today nil) (setq org-habit-graph-column 80) ;; Set up org-habit faces for visual indicators (custom-set-faces '(org-habit-clear-future-face ((t (:background "green" :foreground "black")))) '(org-habit-clear-face ((t (:background "green" :foreground "black"))))) ;; Function to highlight habits on track in the agenda (defun highlight-habits-on-track () "Highlight habits in green when they are on track in the agenda." (save-excursion (goto-char (point-min)) (while (re-search-forward org-habit-heading-regexp nil t) (let* ((habit-marker (get-text-property (match-beginning 0) 'org-habit-p)) (habit-status (org-habit-get-status habit-marker))) (when (and (org-habit-p habit-marker) (eq habit-status 'clear) (not (eq habit-status (get-text-property (match-beginning 0) 'faces)))) (org-remove-flyspell-overlays-in (match-beginning 0) (match-end 0)) (org-add-flyspell-overlays-in (match-beginning 0) (match-end 0)) (org-set-font-lock-defaults) (add-text-properties (match-beginning 0) (match-end 0) `(faces (org-habit-clear-face)))))))) ;; Hook to run the highlight function in the agenda (add-hook 'org-agenda-finalize-hook #'highlight-habits-on-track) - Add the following to your config file (e.g.,
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.