diff --git a/config.el b/config.el index 985a792..1fef370 100644 --- a/config.el +++ b/config.el @@ -38,10 +38,6 @@ ;; (remove-hook 'doom-switch-buffer-hook #'+org--restart-mode-h ;; 'local))) -;; If you use `org' and don't want your org files in the default location below, -;; change `org-directory'. It must be set before org loads! -(setq org-directory "~/Nextcloud/org/") - ;; (defun max/org-gtd--incubate () ;; "Process GTD inbox item by incubating it. ;; Allow the user apply user-defined tags from @@ -438,10 +434,6 @@ (after! persp-mode (setq persp-emacsclient-init-frame-behaviour-override "main")) -(map! :after org - :map org-mode-map - :localleader - "Y" #'ox-clip-image-to-clipboard) (after! evil-snipe (setq evil-snipe-spillover-scope 'visible)) @@ -477,6 +469,6 @@ (save-buffer)) ;; load personal modules -(load! "email") -(load! "gtd") (load! "org") +(load! "gtd") +(load! "email") diff --git a/gtd.el b/gtd.el index fff5e82..a031195 100644 --- a/gtd.el +++ b/gtd.el @@ -17,6 +17,9 @@ ,(concat "* %?\n" ":PROPERTIES:\n:CREATED: %U\n:END:") :prepend t) ;; ("j" "Journal" entry (file+datetree ,(funcall #'gtd-get-current-journal)) + ("l" "Link" entry (file "gtd/inbox.org") + ,(concat "* Process %:annotation\n" + ":PROPERTIES:\n:CREATED: %U\n:END:") :prepend t) ("j" "Journal" entry (file+datetree "gtd/journal.org") ,(concat "* %?\n" ":PROPERTIES:\n:CREATED: %U\n:END:")) @@ -132,7 +135,19 @@ See also `org-save-all-org-buffers'" t))) (message "Saving org-agenda-files buffers... done")) +;; TODO: use org-after-refile-insert-hook ?? +(defun gtd-update-statistics-cookies () + "Save `org-agenda-files' buffers without user confirmation. +See also `org-save-all-org-buffers'" + (interactive) + (message "Updating cookies in org-agenda-files buffers...") + (save-some-buffers t (lambda () + (when (member (buffer-file-name) org-agenda-files) + t))) + (message "Updating cookies in org-agenda-files buffers... done")) + (after! org + ;; (advice-add 'org-refile :after (lambda (&rest _) (org-update-statistics-cookies t))) (advice-add 'org-refile :after (lambda (&rest _) (gtd-save-org-buffers))) (advice-add 'org-todo :after (lambda (&rest _) (gtd-save-org-buffers))) (advice-add 'org-add-note :after (lambda (&rest _) (gtd-save-org-buffers))) diff --git a/init.el b/init.el index e7a4bd9..37fe8bf 100644 --- a/init.el +++ b/init.el @@ -151,7 +151,7 @@ nix ; I hereby declare "nix geht mehr!" ;;ocaml ; an objective camel (org +noter +journal +roam2 +dragndrop +pomodoro) ; organize your plain life in plain text - ;;php ; perl's insecure younger brother + php ; perl's insecure younger brother ;;plantuml ; diagrams for confusing people more ;;purescript ; javascript, but functional (python +lsp +pyright +poetry) ; beautiful is better than ugly @@ -160,7 +160,7 @@ ;;raku ; the artist formerly known as perl6 ;;rest ; Emacs as a REST client ;;rst ; ReST in peace - ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} + (ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} ;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() ;; (scala +lsp) ; java, but good ;;(scheme +guile) ; a fully conniving family of lisps diff --git a/org.el b/org.el index 1b7cd66..4cbf289 100644 --- a/org.el +++ b/org.el @@ -1,5 +1,11 @@ ;;; org.el -*- lexical-binding: t; -*- +;; If you use `org' and don't want your org files in the default location below, +;; change `org-directory'. It must be set before org loads! +(setq org-directory "~/Nextcloud/org/") + +(require 'org) + (defun max/org-clock-get-clock-string () "Form a clock string that will be shown in polybar. Adapted from `org-clock-get-clock-string'." @@ -21,10 +27,19 @@ Adapted from `org-clock-get-clock-string'." current-work-done-str org-clock-heading))))) +;; Fix org-babel shell block not inheriting envrc +;; https://github.com/purcell/envrc/issues/28 +(advice-add 'org-babel-eval :around #'envrc-propagate-environment) + (after! org ;; Store org links to info pages (add-to-list 'org-modules 'ol-info)) +;; C-k is mapped to ~org-element-up~ by defualt +(map! :after evil-org + :map evil-org-mode-map + :i "C-k" #'org-kill-line) + (map! :after org :map org-mode-map :localleader diff --git a/packages.el b/packages.el index 7ba6c3f..54ee42a 100644 --- a/packages.el +++ b/packages.el @@ -87,7 +87,7 @@ (package! nov) ;; (package! org-gtd) ;; (package! weblorg) - +(package! evil-escape :disable t) (package! emacs-codeql :recipe (:host github :repo "anticomputer/emacs-codeql" diff --git a/roam.el b/roam.el index 8ab789a..1261327 100644 --- a/roam.el +++ b/roam.el @@ -2,11 +2,32 @@ (after! org-roam (setq org-roam-capture-templates - '(("d" "default" plain + '(("m" "main" plain "%?" :target (file+head - "${slug}.org" + "main/${slug}.org" + "#+title: ${title}\n") + :unnarrowed t) + ("c" "cheatsheet" plain + "%?" + :target + (file+head + "cheatsheet/${slug}.org" + "#+title: ${title}\n") + :unnarrowed t) + ("w" "worksheet" plain + "%?" + :target + (file+head + "worksheet/${slug}.org" + "#+title: ${title}\n") + :unnarrowed t) + ("p" "person" plain + "%?" + :target + (file+head + "person/${slug}.org" "#+title: ${title}\n") :unnarrowed t) ("n" "literature note" plain