diff --git a/doom.d/config.el b/doom.d/config.el index 40cfb7d..6e5c033 100644 --- a/doom.d/config.el +++ b/doom.d/config.el @@ -431,6 +431,22 @@ independent key tables." (after! org (setq org-tag-alist '(("proj" . ?p)))) +(after! org + (add-to-list 'org-modules 'org-habit)) + +(require 'ansi-color) + +(after! org + (defun nm/babel-ansi () + (when-let ((beg (org-babel-where-is-src-block-result nil nil))) + (save-excursion + (goto-char beg) + (when (looking-at org-babel-result-regexp) + (let ((end (org-babel-result-end)) + (ansi-color-context-region nil)) + (ansi-color-apply-on-region beg end)))))) + (add-hook 'org-babel-after-execute-hook 'nm/babel-ansi)) + (use-package! magit-todos :hook (magit-mode . magit-todos-mode)) diff --git a/doom.d/config.org b/doom.d/config.org index 40ff6e2..c122a33 100644 --- a/doom.d/config.org +++ b/doom.d/config.org @@ -567,6 +567,32 @@ Not only does this feature have performance issues, its not useful with how I us (after! org (setq org-tag-alist '(("proj" . ?p)))) #+end_src +** Modules configuration +*** org habits +Enable the module +#+begin_src emacs-lisp +(after! org + (add-to-list 'org-modules 'org-habit)) +#+end_src +** Babel config +*** Ansi colors +First, bring in ~ansi-color~ +#+begin_src emacs-lisp +(require 'ansi-color) +#+end_src +Then, hook into babel and apply those colors +#+begin_src emacs-lisp +(after! org + (defun nm/babel-ansi () + (when-let ((beg (org-babel-where-is-src-block-result nil nil))) + (save-excursion + (goto-char beg) + (when (looking-at org-babel-result-regexp) + (let ((end (org-babel-result-end)) + (ansi-color-context-region nil)) + (ansi-color-apply-on-region beg end)))))) + (add-hook 'org-babel-after-execute-hook 'nm/babel-ansi)) +#+end_src * General Modes ** Magit Further configuration for magit