Compare commits
22 Commits
1a77edb635
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| c4b861996f | |||
| ad762f9e92 | |||
| 70e56bfbaf | |||
| 05dd325fda | |||
| e168ba24b3 | |||
| 1de6abe136 | |||
| 655b40956b | |||
| 5c37f99702 | |||
| 07c8e15411 | |||
| 24f8d78e58 | |||
| ec3c516deb | |||
| 154a5faebe | |||
| 6951ffc0c3 | |||
| ee3c5f2a1b | |||
| 2cab09f8fe | |||
| a6c9081861 | |||
| eb88540696 | |||
| 618e69fc3d | |||
| 0d8c0a6164 | |||
| 6b067d40d2 | |||
| 269e10e9d8 | |||
| 1c6307dba8 |
232
config.el
232
config.el
@@ -21,7 +21,7 @@
|
|||||||
;;
|
;;
|
||||||
;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd
|
;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd
|
||||||
;; font string. You generally only need these two:
|
;; font string. You generally only need these two:
|
||||||
(setq doom-font (font-spec :family "Fira Mono" :size 14.0)
|
(setq doom-font (font-spec :family "FiraCode Nerd Font" :size 14.0)
|
||||||
doom-variable-pitch-font (font-spec :family "Liberation Serif" :size 16.0))
|
doom-variable-pitch-font (font-spec :family "Liberation Serif" :size 16.0))
|
||||||
|
|
||||||
;; There are two ways to load a theme. Both assume the theme is installed and
|
;; There are two ways to load a theme. Both assume the theme is installed and
|
||||||
@@ -38,14 +38,6 @@
|
|||||||
;; (remove-hook 'doom-switch-buffer-hook #'+org--restart-mode-h
|
;; (remove-hook 'doom-switch-buffer-hook #'+org--restart-mode-h
|
||||||
;; 'local)))
|
;; '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/")
|
|
||||||
|
|
||||||
(after! org
|
|
||||||
;; Store org links to info pages
|
|
||||||
(add-to-list 'org-modules 'ol-info))
|
|
||||||
|
|
||||||
;; (defun max/org-gtd--incubate ()
|
;; (defun max/org-gtd--incubate ()
|
||||||
;; "Process GTD inbox item by incubating it.
|
;; "Process GTD inbox item by incubating it.
|
||||||
;; Allow the user apply user-defined tags from
|
;; Allow the user apply user-defined tags from
|
||||||
@@ -222,10 +214,6 @@
|
|||||||
;; :category "next"))
|
;; :category "next"))
|
||||||
;; ))))))))
|
;; ))))))))
|
||||||
|
|
||||||
|
|
||||||
(use-package! org-inline-pdf
|
|
||||||
:hook (org-mode . org-inline-pdf-mode))
|
|
||||||
|
|
||||||
(use-package! indium
|
(use-package! indium
|
||||||
:hook ((js-mode typescript-mode) . indium-interaction-mode)
|
:hook ((js-mode typescript-mode) . indium-interaction-mode)
|
||||||
:init
|
:init
|
||||||
@@ -239,146 +227,6 @@
|
|||||||
(map! :map Info-mode-map
|
(map! :map Info-mode-map
|
||||||
:n "g n" #'Info-goto-node))
|
:n "g n" #'Info-goto-node))
|
||||||
|
|
||||||
;; (setq max/org-calendar-directory (concat org-directory "calendar/"))
|
|
||||||
;; (setq max/org-calendar-file (concat max/org-calendar-directory "calendar.org"))
|
|
||||||
|
|
||||||
;;; https://www.reddit.com/r/orgmode/comments/8rl8ep/making_orgcaldav_useable/
|
|
||||||
;; (use-package! org-caldav
|
|
||||||
;; :after org
|
|
||||||
;; :init
|
|
||||||
;; ;; (defun org-caldav-sync-at-close ()
|
|
||||||
;; ;; (org-caldav-sync)
|
|
||||||
;; ;; (save-some-buffers))
|
|
||||||
|
|
||||||
;; ;; (defvar org-caldav-sync-timer nil
|
|
||||||
;; ;; "Timer that `org-caldav-push-timer' used to reschedule itself, or nil.")
|
|
||||||
;; ;; (defun org-caldav-sync-with-delay (secs)
|
|
||||||
;; ;; (when org-caldav-sync-timer
|
|
||||||
;; ;; (cancel-timer org-caldav-sync-timer))
|
|
||||||
;; ;; (setq org-caldav-sync-timer
|
|
||||||
;; ;; (run-with-idle-timer
|
|
||||||
;; ;; (* 1 secs) nil 'org-caldav-sync)))
|
|
||||||
|
|
||||||
;; (setq org-icalendar-alarm-time 1)
|
|
||||||
;; :config
|
|
||||||
;; (setq org-caldav-resume-aborted 'always
|
|
||||||
;; org-caldav-save-directory max/org-calendar-directory
|
|
||||||
;; org-caldav-backup-file (concat max/org-calendar-directory "org-caldav-backup.org")
|
|
||||||
;; org-caldav-url "https://nextcloud.maxschlueter.com/remote.php/dav/calendars/max"
|
|
||||||
;; org-caldav-calendar-id "calendar"
|
|
||||||
;; org-caldav-files `(,max/org-calendar-file)
|
|
||||||
;; org-caldav-inbox max/org-calendar-file)
|
|
||||||
|
|
||||||
;; (after! org-agenda
|
|
||||||
;; (add-to-list 'org-agenda-files max/org-calendar-file t)
|
|
||||||
;; (setq org-agenda-include-diary t
|
|
||||||
;; org-agenda-insert-diary-strategy 'top-level
|
|
||||||
;; org-agenda-insert-diary-extract-time t
|
|
||||||
;; org-agenda-diary-file max/org-calendar-file))
|
|
||||||
|
|
||||||
;; ;; (setq org-caldav-calendars
|
|
||||||
;; ;; `((:calendar-id "personal"
|
|
||||||
;; ;; :files (,(concat max/org-calendar-directory "personal.org"))
|
|
||||||
;; ;; :inbox ,(concat max/org-calendar-directory "personal.org"))
|
|
||||||
;; ;; (:calendar-id "work"
|
|
||||||
;; ;; :files (,(concat max/org-calendar-directory "work.org"))
|
|
||||||
;; ;; :inbox ,(concat max/org-calendar-directory "work.org"))
|
|
||||||
;; ;; ))
|
|
||||||
|
|
||||||
;; (defun max/org-caldav-get-inbox ()
|
|
||||||
;; (let* ((calid (completing-read "Calendar: "
|
|
||||||
;; (cl-loop for cal in org-caldav-calendars
|
|
||||||
;; collect (plist-get cal :calendar-id))
|
|
||||||
;; nil t))
|
|
||||||
;; (calinbox (cl-loop for cal in org-caldav-calendars
|
|
||||||
;; when (string= (plist-get cal :calendar-id) calid)
|
|
||||||
;; return (plist-get cal :inbox))))
|
|
||||||
;; calinbox))
|
|
||||||
;; ;; (add-hook 'after-save-hook
|
|
||||||
;; ;; (lambda ()
|
|
||||||
;; ;; (when (eq major-mode 'org-mode)
|
|
||||||
;; ;; (org-caldav-sync-with-delay 300))))
|
|
||||||
;; ;; (add-hook 'kill-emacs-hook 'org-caldav-sync-at-close)
|
|
||||||
;; )
|
|
||||||
|
|
||||||
(use-package! org-roam-ui
|
|
||||||
:after org-roam
|
|
||||||
:config
|
|
||||||
(setq org-roam-ui-sync-theme t
|
|
||||||
org-roam-ui-follow t
|
|
||||||
org-roam-ui-update-on-save t
|
|
||||||
org-roam-ui-open-on-start t))
|
|
||||||
|
|
||||||
(setq +org-roam-open-buffer-on-find-file nil)
|
|
||||||
|
|
||||||
(after! org-roam
|
|
||||||
(setq org-roam-capture-templates
|
|
||||||
'(("d" "default" plain
|
|
||||||
"%?"
|
|
||||||
:target
|
|
||||||
(file+head
|
|
||||||
"${slug}.org"
|
|
||||||
"#+title: ${note-title}\n")
|
|
||||||
:unnarrowed t)
|
|
||||||
("n" "literature note" plain
|
|
||||||
"%?"
|
|
||||||
:target
|
|
||||||
(file+head
|
|
||||||
"%(concat
|
|
||||||
(when citar-org-roam-subdir (concat citar-org-roam-subdir \"/\")) \"${citekey}.org\")"
|
|
||||||
"#+title: ${title}\n")
|
|
||||||
:unnarrowed t)))
|
|
||||||
(setq org-roam-dailies-capture-templates
|
|
||||||
'(("d" "default" entry
|
|
||||||
"* %?"
|
|
||||||
:target (file+head "%<%Y-%m-%d>.org"
|
|
||||||
"#+title: %<%Y-%m-%d>\n"))))
|
|
||||||
;; ("j" "journal" entry
|
|
||||||
;; #'org-roam-capture--get-point
|
|
||||||
;; "* %?"
|
|
||||||
;; :file-name "daily/%<%Y-%m-%d>"
|
|
||||||
;; :head "#+title: %<%Y-%m-%d>\n"
|
|
||||||
;; :olp ("Journal"))))
|
|
||||||
(map! :leader
|
|
||||||
:desc "Capture today" "n n" #'org-roam-dailies-capture-today)
|
|
||||||
(setq org-roam-directory (concat org-directory "roam/")
|
|
||||||
org-roam-completion-everywhere nil))
|
|
||||||
|
|
||||||
(after! citar
|
|
||||||
;; (setq citar-file-parser-functions
|
|
||||||
;; '(citar-file--parser-default
|
|
||||||
;; citar-file--parser-triplet))
|
|
||||||
(setq citar-org-roam-capture-template-key "n")
|
|
||||||
(setq! citar-library-paths '("~/Zotero" "~/Nextcloud/Calibre")
|
|
||||||
citar-notes-paths `(,(expand-file-name "reference" org-roam-directory))
|
|
||||||
citar-bibliography `(,(expand-file-name "library.bib" org-roam-directory)
|
|
||||||
,(expand-file-name "books.bib" org-roam-directory))))
|
|
||||||
|
|
||||||
(after! citar-org-roam
|
|
||||||
;; (citar-register-notes-source
|
|
||||||
;; 'orb-citar-source (list :name "Org-Roam Notes"
|
|
||||||
;; :category 'org-roam-node
|
|
||||||
;; :items #'citar-org-roam--get-candidates
|
|
||||||
;; :hasitems #'citar-org-roam-has-notes
|
|
||||||
;; :open #'citar-org-roam-open-note
|
|
||||||
;; :create #'orb-citar-edit-note
|
|
||||||
;; :annotate #'citar-org-roam--annotate))
|
|
||||||
;; (setq citar-notes-source 'orb-citar-source)
|
|
||||||
(setq citar-org-roam-subdir "reference"))
|
|
||||||
|
|
||||||
(use-package! org-transclusion
|
|
||||||
:after org
|
|
||||||
:init
|
|
||||||
(map!
|
|
||||||
:map global-map "<f12>" #'org-transclusion-add
|
|
||||||
:leader
|
|
||||||
:prefix "n"
|
|
||||||
:desc "Org Transclusion Mode" "t" #'org-transclusion-mode))
|
|
||||||
|
|
||||||
(after! org-noter
|
|
||||||
;; (map! :map pdf-view-mode-map "i" nil)
|
|
||||||
;; (map! :map pdf-view-mode-map :gn "i" #'org-noter-insert-note)
|
|
||||||
(setq org-noter-always-create-frame t))
|
|
||||||
|
|
||||||
(after! biblio
|
(after! biblio
|
||||||
(map! :map biblio-selection-mode-map
|
(map! :map biblio-selection-mode-map
|
||||||
@@ -404,9 +252,6 @@
|
|||||||
'ivy-bibtex
|
'ivy-bibtex
|
||||||
'(("x" max/ivy-bibtex-org-capture "Capture PDF to read"))))
|
'(("x" max/ivy-bibtex-org-capture "Capture PDF to read"))))
|
||||||
|
|
||||||
(use-package! nov
|
|
||||||
:mode ("\\.epub\\'" . nov-mode))
|
|
||||||
|
|
||||||
;; Taken from: https://github.com/hlissner/doom-emacs/pull/6077
|
;; Taken from: https://github.com/hlissner/doom-emacs/pull/6077
|
||||||
;; (use-package! org-roam-bibtex
|
;; (use-package! org-roam-bibtex
|
||||||
;; ;; :when (featurep! :lang org +roam2)
|
;; ;; :when (featurep! :lang org +roam2)
|
||||||
@@ -452,27 +297,6 @@
|
|||||||
|
|
||||||
;; (setq ns-auto-hide-menu-bar t)
|
;; (setq ns-auto-hide-menu-bar t)
|
||||||
|
|
||||||
(defun max/org-clock-get-clock-string ()
|
|
||||||
"Form a clock string that will be shown in polybar.
|
|
||||||
Adapted from `org-clock-get-clock-string'."
|
|
||||||
(require 'org-clock)
|
|
||||||
(when (org-clocking-p)
|
|
||||||
(let* ((currently-clocked-time
|
|
||||||
(floor (org-time-convert-to-integer
|
|
||||||
(time-since org-clock-start-time))
|
|
||||||
60))
|
|
||||||
(clocked-time (org-clock-get-clocked-time))
|
|
||||||
(current-work-done-str (org-duration-from-minutes currently-clocked-time)))
|
|
||||||
(if org-clock-effort
|
|
||||||
(let* ((effort-in-minutes (org-duration-to-minutes org-clock-effort))
|
|
||||||
(work-done-str (org-duration-from-minutes clocked-time))
|
|
||||||
(effort-str (org-duration-from-minutes effort-in-minutes)))
|
|
||||||
(format "%s (%s/%s) %s"
|
|
||||||
current-work-done-str work-done-str effort-str org-clock-heading))
|
|
||||||
(format "%s %s"
|
|
||||||
current-work-done-str
|
|
||||||
(org-duration-from-minutes clocked-time)
|
|
||||||
org-clock-heading)))))
|
|
||||||
|
|
||||||
;; (defun my/toggle-org-agenda ()
|
;; (defun my/toggle-org-agenda ()
|
||||||
;; "Toggle my custom org agenda view"
|
;; "Toggle my custom org agenda view"
|
||||||
@@ -481,7 +305,6 @@ Adapted from `org-clock-get-clock-string'."
|
|||||||
;; (org-agenda-quit)
|
;; (org-agenda-quit)
|
||||||
;; (org-agenda nil " ")))
|
;; (org-agenda nil " ")))
|
||||||
|
|
||||||
|
|
||||||
(after! auth-source
|
(after! auth-source
|
||||||
(when IS-MAC
|
(when IS-MAC
|
||||||
(setq auth-sources '(macos-keychain-internet macos-keychain-generic))))
|
(setq auth-sources '(macos-keychain-internet macos-keychain-generic))))
|
||||||
@@ -513,15 +336,14 @@ Adapted from `org-clock-get-clock-string'."
|
|||||||
|
|
||||||
(setq +latex-viewers '(pdf-tools))
|
(setq +latex-viewers '(pdf-tools))
|
||||||
|
|
||||||
(setq org-roam-directory (concat org-directory "roam/"))
|
(after! eww
|
||||||
|
(setq eww-auto-rename-buffer 'title))
|
||||||
|
|
||||||
|
|
||||||
;; (setq! +biblio-pdf-library-dir "~/Nextcloud/Papers/"
|
;; (setq! +biblio-pdf-library-dir "~/Nextcloud/Papers/"
|
||||||
;; +biblio-default-bibliography-files '("~/Nextcloud/Papers/library.bib")
|
;; +biblio-default-bibliography-files '("~/Nextcloud/Papers/library.bib")
|
||||||
;; +biblio-notes-path org-roam-directory)
|
;; +biblio-notes-path org-roam-directory)
|
||||||
|
|
||||||
(after! org-roam-bibtex
|
|
||||||
(setq orb-insert-link-description 'citekey))
|
|
||||||
|
|
||||||
;; https://tecosaur.github.io/emacs-config/config.html#getting-notified
|
;; https://tecosaur.github.io/emacs-config/config.html#getting-notified
|
||||||
;; http://cachestocaches.com/2017/3/complete-guide-email-emacs-using-mu-and-/
|
;; http://cachestocaches.com/2017/3/complete-guide-email-emacs-using-mu-and-/
|
||||||
;; (use-package! mu4e-alert
|
;; (use-package! mu4e-alert
|
||||||
@@ -555,10 +377,6 @@ Adapted from `org-clock-get-clock-string'."
|
|||||||
(after! persp-mode
|
(after! persp-mode
|
||||||
(setq persp-emacsclient-init-frame-behaviour-override "main"))
|
(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
|
(after! evil-snipe
|
||||||
(setq evil-snipe-spillover-scope 'visible))
|
(setq evil-snipe-spillover-scope 'visible))
|
||||||
@@ -589,23 +407,39 @@ Adapted from `org-clock-get-clock-string'."
|
|||||||
(setq codeql-transient-binding "C-c q")
|
(setq codeql-transient-binding "C-c q")
|
||||||
(setq codeql-configure-eglot-lsp t))
|
(setq codeql-configure-eglot-lsp t))
|
||||||
|
|
||||||
;; (server-start)
|
(defadvice! +default--dont-prompt-for-save-file-a (&rest _)
|
||||||
|
:before #'server-edit
|
||||||
|
(save-buffer))
|
||||||
|
|
||||||
;; (use-package! mac-pseudo-daemon
|
(use-package! gptel
|
||||||
;; :config
|
:config
|
||||||
;; (mac-pseudo-daemon-mode)
|
(setq! gptel-api-key (lambda () (with-temp-buffer
|
||||||
;; )
|
(insert-file-contents "/run/secrets/chatgpt_api_key")
|
||||||
|
(buffer-string)))))
|
||||||
|
|
||||||
|
(use-package! copilot
|
||||||
|
:hook (prog-mode . copilot-mode)
|
||||||
|
:bind (:map copilot-completion-map
|
||||||
|
("<tab>" . 'copilot-accept-completion)
|
||||||
|
("TAB" . 'copilot-accept-completion)
|
||||||
|
("C-TAB" . 'copilot-accept-completion-by-word)
|
||||||
|
("C-<tab>" . 'copilot-accept-completion-by-word)))
|
||||||
|
;; 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 "~/Sync/Logseq/")
|
||||||
|
|
||||||
;; (load! nix-docbook-mode)
|
;; C-k is mapped to ~org-element-up~ by default
|
||||||
|
(map! :after org
|
||||||
;;; (after! calfw-org
|
:map evil-org-mode-map
|
||||||
;;; (autoload (function cfw:org-create-file-source) "cfw:org-create-file-source" nil t))
|
:i "C-k" #'org-kill-line)
|
||||||
|
|
||||||
;;; (after! calfw-org
|
|
||||||
;;; (autoload #'cfw:org-create-file-source "cfw:org-create-file-source"))
|
|
||||||
|
|
||||||
|
(map! :after org
|
||||||
|
:map org-mode-map
|
||||||
|
:localleader
|
||||||
|
"Y" #'ox-clip-image-to-clipboard)
|
||||||
|
|
||||||
;; load personal modules
|
;; load personal modules
|
||||||
(load! "email")
|
;; (load! "org")
|
||||||
(load! "gtd")
|
(load! "gtd")
|
||||||
|
(load! "roam")
|
||||||
|
(load! "email")
|
||||||
|
|||||||
41
email.el
41
email.el
@@ -1,6 +1,10 @@
|
|||||||
;;; email.el -*- lexical-binding: t; -*-
|
;;; email.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(after! mu4e
|
;; Start mu4e in the background
|
||||||
|
;; https://github.com/djcb/mu/issues/2282
|
||||||
|
(require 'mu4e)
|
||||||
|
(mu4e 'background)
|
||||||
|
|
||||||
;; Recommended msmtp config from doom module documentation
|
;; Recommended msmtp config from doom module documentation
|
||||||
(setq sendmail-program (executable-find "msmtp")
|
(setq sendmail-program (executable-find "msmtp")
|
||||||
send-mail-function #'smtpmail-send-it
|
send-mail-function #'smtpmail-send-it
|
||||||
@@ -48,6 +52,8 @@
|
|||||||
mu4e-drafts-folder "/mailbox/Drafts"
|
mu4e-drafts-folder "/mailbox/Drafts"
|
||||||
mu4e-trash-folder "/mailbox/Trash"
|
mu4e-trash-folder "/mailbox/Trash"
|
||||||
mu4e-refile-folder "/mailbox/Archive"
|
mu4e-refile-folder "/mailbox/Archive"
|
||||||
|
;; TODO create context-aware variable
|
||||||
|
mu4e-spam-folder "/mailbox/Junk"
|
||||||
mu4e-compose-signature nil
|
mu4e-compose-signature nil
|
||||||
mu4e-maildir-shortcuts (list (list :maildir "/mailbox/Inbox"
|
mu4e-maildir-shortcuts (list (list :maildir "/mailbox/Inbox"
|
||||||
:key ?i)
|
:key ?i)
|
||||||
@@ -73,6 +79,11 @@
|
|||||||
:hide-unread t
|
:hide-unread t
|
||||||
:key ?t)))
|
:key ?t)))
|
||||||
|
|
||||||
|
;; TODO helper function used by `+mu4e-view-select-mime-part-action' is deprecated
|
||||||
|
;; https://github.com/doomemacs/doomemacs/issues/7847
|
||||||
|
(map! :map mu4e-view-mode-map
|
||||||
|
:ne "A" #'mu4e-view-mime-part-action)
|
||||||
|
|
||||||
;; Render buttons to verify&decrypt messages
|
;; Render buttons to verify&decrypt messages
|
||||||
(setq mm-decrypt-option 'always
|
(setq mm-decrypt-option 'always
|
||||||
mm-verify-option 'always
|
mm-verify-option 'always
|
||||||
@@ -92,6 +103,21 @@
|
|||||||
;; IMAP-deleted:
|
;; IMAP-deleted:
|
||||||
(mu4e--server-move docid (mu4e--mark-check-target target) "+S-u-N"))))
|
(mu4e--server-move docid (mu4e--mark-check-target target) "+S-u-N"))))
|
||||||
|
|
||||||
|
(add-to-list 'mu4e-marks
|
||||||
|
'(spam
|
||||||
|
:char "S"
|
||||||
|
:prompt "Spam"
|
||||||
|
:shot-target (lambda (target) mu4e-spam-folder)
|
||||||
|
:action (lambda (docid msg target)
|
||||||
|
(mu4e--server-move docid mu4e-spam-folder "+S-u-N"))))
|
||||||
|
|
||||||
|
(defun my:mu4e-mark-for-spam()
|
||||||
|
"Mark as read and move to spam."
|
||||||
|
(interactive)
|
||||||
|
(mu4e-headers-mark-and-next 'spam))
|
||||||
|
|
||||||
|
(map! :map mu4e-headers-mode-map :n "S" #'my:mu4e-mark-for-spam)
|
||||||
|
|
||||||
(add-to-list 'mu4e-view-mime-part-actions
|
(add-to-list 'mu4e-view-mime-part-actions
|
||||||
'(:name "calendar"
|
'(:name "calendar"
|
||||||
:handler (lambda (file)
|
:handler (lambda (file)
|
||||||
@@ -104,7 +130,6 @@
|
|||||||
;; (add-hook 'message-send-hook 'mml-secure-message-sign-smime)
|
;; (add-hook 'message-send-hook 'mml-secure-message-sign-smime)
|
||||||
|
|
||||||
(require 'khalel-icalendar)
|
(require 'khalel-icalendar)
|
||||||
)
|
|
||||||
|
|
||||||
;; (defun max/mu4e-view-import-attachment-calendar (msg attnum)
|
;; (defun max/mu4e-view-import-attachment-calendar (msg attnum)
|
||||||
;; (let* ((att (mu4e~view-get-attach msg attnum))
|
;; (let* ((att (mu4e~view-get-attach msg attnum))
|
||||||
@@ -122,17 +147,7 @@
|
|||||||
;; (add-to-list 'mu4e-view-attachment-actions
|
;; (add-to-list 'mu4e-view-attachment-actions
|
||||||
;; '("cImport in calendar" . max/mu4e-view-import-attachment-calendar) t)
|
;; '("cImport in calendar" . max/mu4e-view-import-attachment-calendar) t)
|
||||||
|
|
||||||
;; Autoload this command so that the mbsync service can update the index
|
(map! "<f2>" #'=mu4e)
|
||||||
(autoload #'mu4e-update-index "mu4e" nil t)
|
|
||||||
|
|
||||||
(defun max/=mu4e ()
|
|
||||||
"Start email client and view all inboxes."
|
|
||||||
(interactive)
|
|
||||||
(require 'mu4e)
|
|
||||||
(+workspace-switch +mu4e-workspace-name t)
|
|
||||||
(mu4e--start (lambda () (mu4e-headers-search (mu4e-get-bookmark-query ?i)))))
|
|
||||||
|
|
||||||
(map! "<f2>" #'max/=mu4e)
|
|
||||||
|
|
||||||
(after! epa
|
(after! epa
|
||||||
(setq epa-keyserver "keys.openpgp.org")
|
(setq epa-keyserver "keys.openpgp.org")
|
||||||
|
|||||||
122
gtd.el
122
gtd.el
@@ -3,8 +3,12 @@
|
|||||||
(after! org
|
(after! org
|
||||||
(setq org-return-follows-link t
|
(setq org-return-follows-link t
|
||||||
org-complete-tags-always-offer-all-agenda-tags t
|
org-complete-tags-always-offer-all-agenda-tags t
|
||||||
org-agenda-files (mapcar 'file-truename
|
org-agenda-files (mapcar (lambda (filename) (expand-file-name filename org-directory))
|
||||||
(file-expand-wildcards (concat org-directory "gtd/*.org"))))
|
'("gtd/inbox.org"
|
||||||
|
"gtd/tasks.org"
|
||||||
|
"caldav/personal.org" ;; synced by khalel
|
||||||
|
"gtd/journal.org")))
|
||||||
|
;; (file-expand-wildcards (concat org-directory "gtd/*.org"))))
|
||||||
;; org-agenda-files (append (mapcar 'file-truename
|
;; org-agenda-files (append (mapcar 'file-truename
|
||||||
;; (file-expand-wildcards (concat org-directory "gtd/*.org")))
|
;; (file-expand-wildcards (concat org-directory "gtd/*.org")))
|
||||||
;; (list (expand-file-name (funcall #'gtd-get-current-journal) org-directory))))
|
;; (list (expand-file-name (funcall #'gtd-get-current-journal) org-directory))))
|
||||||
@@ -13,6 +17,9 @@
|
|||||||
,(concat "* %?\n"
|
,(concat "* %?\n"
|
||||||
":PROPERTIES:\n:CREATED: %U\n:END:") :prepend t)
|
":PROPERTIES:\n:CREATED: %U\n:END:") :prepend t)
|
||||||
;; ("j" "Journal" entry (file+datetree ,(funcall #'gtd-get-current-journal))
|
;; ("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")
|
("j" "Journal" entry (file+datetree "gtd/journal.org")
|
||||||
,(concat "* %?\n"
|
,(concat "* %?\n"
|
||||||
":PROPERTIES:\n:CREATED: %U\n:END:"))
|
":PROPERTIES:\n:CREATED: %U\n:END:"))
|
||||||
@@ -25,8 +32,21 @@
|
|||||||
org-refile-target-verify-function (lambda (&rest _) (null (org-get-todo-state)))
|
org-refile-target-verify-function (lambda (&rest _) (null (org-get-todo-state)))
|
||||||
;; org-refile-target-verify-function nil
|
;; org-refile-target-verify-function nil
|
||||||
;; org-refile-targets '(("tasks.org" . (:maxlevel . 2))))
|
;; org-refile-targets '(("tasks.org" . (:maxlevel . 2))))
|
||||||
org-refile-targets '(("tasks.org" . (:maxlevel . 2))
|
org-refile-targets `(("tasks.org" . (:maxlevel . 2))
|
||||||
("someday.org" . (:level . 0)))))
|
(,(expand-file-name "gtd/someday.org" org-directory) . (:maxlevel . 1)))))
|
||||||
|
|
||||||
|
;; Getting the following on capture:
|
||||||
|
;;
|
||||||
|
;; Greedy org-protocol handler. Killing client.
|
||||||
|
;; No server buffers remain to edit
|
||||||
|
;;
|
||||||
|
;; See https://github.com/alphapapa/org-protocol-capture-html/issues/40
|
||||||
|
;; (use-package! org-protocol-capture-html
|
||||||
|
;; :after org-protocol
|
||||||
|
;; :config
|
||||||
|
;; (add-to-list 'org-capture-templates
|
||||||
|
;; '("w" "Website" entry (file "")
|
||||||
|
;; "* %a :website:\n\n%U %?\n\n%:initial"))
|
||||||
|
|
||||||
(defun gtd-capture-inbox ()
|
(defun gtd-capture-inbox ()
|
||||||
(interactive)
|
(interactive)
|
||||||
@@ -115,7 +135,19 @@ See also `org-save-all-org-buffers'"
|
|||||||
t)))
|
t)))
|
||||||
(message "Saving org-agenda-files buffers... done"))
|
(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
|
(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-refile :after (lambda (&rest _) (gtd-save-org-buffers)))
|
||||||
(advice-add 'org-todo :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)))
|
(advice-add 'org-add-note :after (lambda (&rest _) (gtd-save-org-buffers)))
|
||||||
@@ -152,11 +184,16 @@ the current import date range."
|
|||||||
:config
|
:config
|
||||||
(advice-add #'khalel--insert-import-file-header :override #'max/khalel--insert-import-file-header)
|
(advice-add #'khalel--insert-import-file-header :override #'max/khalel--insert-import-file-header)
|
||||||
(advice-add #'khalel-import-events :around #'doom-shut-up-a)
|
(advice-add #'khalel-import-events :around #'doom-shut-up-a)
|
||||||
|
|
||||||
|
;; HACK: Getting an error message otherwise:
|
||||||
|
;; org-element--list-struct: Tab width in Org files must be 8, not 4. Please adjust your ‘tab-width’ settings for Org mode.
|
||||||
|
;; TODO: Set tab width for org mode only
|
||||||
|
(setq-default tab-width 8)
|
||||||
(setq khalel-default-calendar "personal"
|
(setq khalel-default-calendar "personal"
|
||||||
khalel-import-org-file-confirm-overwrite nil
|
khalel-import-org-file-confirm-overwrite nil
|
||||||
khalel-import-start-date "-15d"
|
khalel-import-start-date "-15d"
|
||||||
khalel-import-end-date "+30d"
|
khalel-import-end-date "+30d"
|
||||||
khalel-import-org-file (expand-file-name "gtd/calendar.org" org-directory)
|
khalel-import-org-file (expand-file-name "caldav/personal.org" org-directory)
|
||||||
khalel-import-format "* {title} {cancelled} :{calendar}:\n\
|
khalel-import-format "* {title} {cancelled} :{calendar}:\n\
|
||||||
:PROPERTIES:\n:CALENDAR: {calendar}\n\
|
:PROPERTIES:\n:CALENDAR: {calendar}\n\
|
||||||
:LOCATION: {location}\n\
|
:LOCATION: {location}\n\
|
||||||
@@ -189,6 +226,54 @@ show up there.\n\n"))
|
|||||||
|
|
||||||
(map! "C-c e" #'gtd-capture-event)
|
(map! "C-c e" #'gtd-capture-event)
|
||||||
|
|
||||||
|
;;; TODO: not working still
|
||||||
|
;;; https://www.reddit.com/r/orgmode/comments/8rl8ep/making_orgcaldav_useable/
|
||||||
|
(use-package! org-caldav
|
||||||
|
:autoload org-caldav-sync
|
||||||
|
:init
|
||||||
|
(defvar +gtd/org-caldav-directory nil
|
||||||
|
"Directory where org-caldav synchronizes the calendars to.")
|
||||||
|
(setq org-icalendar-alarm-time 10)
|
||||||
|
:config
|
||||||
|
(setq org-caldav-resume-aborted 'always
|
||||||
|
+gtd/org-caldav-directory (expand-file-name "caldav" org-directory)
|
||||||
|
org-caldav-save-directory +gtd/org-caldav-directory
|
||||||
|
org-caldav-backup-file (expand-file-name "org-caldav-backup.org" +gtd/org-caldav-directory)
|
||||||
|
org-caldav-url "https://nextcloud.maxschlueter.com/remote.php/dav/calendars/max"
|
||||||
|
org-caldav-calendar-id "test"
|
||||||
|
org-caldav-files `(,(expand-file-name "personal.org" +gtd/org-caldav-directory))
|
||||||
|
org-caldav-inbox (expand-file-name "personal.org" +gtd/org-caldav-directory))
|
||||||
|
|
||||||
|
;; (after! org-agenda
|
||||||
|
;; (add-to-list 'org-agenda-files max/org-calendar-file t)
|
||||||
|
;; (setq org-agenda-include-diary t
|
||||||
|
;; org-agenda-insert-diary-strategy 'top-level
|
||||||
|
;; org-agenda-insert-diary-extract-time t
|
||||||
|
;; org-agenda-diary-file max/org-calendar-file))
|
||||||
|
|
||||||
|
;; (setq org-caldav-calendars
|
||||||
|
;; `((:calendar-id "personal"
|
||||||
|
;; :files (,(expand-file-name "personal.org" +gtd/org-caldav-directory)))))
|
||||||
|
;; :inbox ,(concat max/org-calendar-directory "personal.org"))))
|
||||||
|
|
||||||
|
(defun max/org-caldav-get-inbox ()
|
||||||
|
(let* ((calid (completing-read "Calendar: "
|
||||||
|
(cl-loop for cal in org-caldav-calendars
|
||||||
|
collect (plist-get cal :calendar-id))
|
||||||
|
nil t))
|
||||||
|
(calinbox (cl-loop for cal in org-caldav-calendars
|
||||||
|
when (string= (plist-get cal :calendar-id) calid)
|
||||||
|
return (plist-get cal :inbox))))
|
||||||
|
calinbox)))
|
||||||
|
|
||||||
|
;;
|
||||||
|
;;; Reference system
|
||||||
|
|
||||||
|
(load! "roam")
|
||||||
|
|
||||||
|
;;
|
||||||
|
;;; Misc
|
||||||
|
|
||||||
(after! org
|
(after! org
|
||||||
(setq org-clock-persist t
|
(setq org-clock-persist t
|
||||||
;; Useful when clocking in on a waiting task
|
;; Useful when clocking in on a waiting task
|
||||||
@@ -211,3 +296,30 @@ show up there.\n\n"))
|
|||||||
(setq org-pomodoro-length 25
|
(setq org-pomodoro-length 25
|
||||||
org-pomodoro-short-break-length 5
|
org-pomodoro-short-break-length 5
|
||||||
org-pomodoro-long-break-length 20))
|
org-pomodoro-long-break-length 20))
|
||||||
|
|
||||||
|
(defvar org-clock-heading-str-limit 40
|
||||||
|
"Maximum length of `org-clock-heading' string. Will be truncated if too long.")
|
||||||
|
(defun max/org-clock-get-clock-string ()
|
||||||
|
"Form a clock string that will be shown in a status bar.
|
||||||
|
Adapted from `org-clock-get-clock-string'."
|
||||||
|
(require 'org-clock)
|
||||||
|
(when (org-clocking-p)
|
||||||
|
(let* ((currently-clocked-time
|
||||||
|
(floor (org-time-convert-to-integer
|
||||||
|
(time-since org-clock-start-time))
|
||||||
|
60))
|
||||||
|
(org-clock-heading-str (if (> (length org-clock-heading) org-clock-heading-str-limit)
|
||||||
|
(concat (substring org-clock-heading 0 org-clock-heading-str-limit) "...")
|
||||||
|
org-clock-heading))
|
||||||
|
(clocked-time (org-clock-get-clocked-time))
|
||||||
|
(work-done-str (org-duration-from-minutes clocked-time))
|
||||||
|
(current-work-done-str (org-duration-from-minutes currently-clocked-time)))
|
||||||
|
(if org-clock-effort
|
||||||
|
(let* ((effort-in-minutes (org-duration-to-minutes org-clock-effort))
|
||||||
|
(effort-str (org-duration-from-minutes effort-in-minutes)))
|
||||||
|
(format "%s (%s/%s) %s"
|
||||||
|
org-clock-heading-str work-done-str effort-str current-work-done-str))
|
||||||
|
(format "%s (%s) %s"
|
||||||
|
org-clock-heading-str
|
||||||
|
work-done-str
|
||||||
|
current-work-done-str)))))
|
||||||
|
|||||||
4
init.el
4
init.el
@@ -151,7 +151,7 @@
|
|||||||
nix ; I hereby declare "nix geht mehr!"
|
nix ; I hereby declare "nix geht mehr!"
|
||||||
;;ocaml ; an objective camel
|
;;ocaml ; an objective camel
|
||||||
(org +noter +journal +roam2 +dragndrop +pomodoro) ; organize your plain life in plain text
|
(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
|
;;plantuml ; diagrams for confusing people more
|
||||||
;;purescript ; javascript, but functional
|
;;purescript ; javascript, but functional
|
||||||
(python +lsp +pyright +poetry) ; beautiful is better than ugly
|
(python +lsp +pyright +poetry) ; beautiful is better than ugly
|
||||||
@@ -160,7 +160,7 @@
|
|||||||
;;raku ; the artist formerly known as perl6
|
;;raku ; the artist formerly known as perl6
|
||||||
;;rest ; Emacs as a REST client
|
;;rest ; Emacs as a REST client
|
||||||
;;rst ; ReST in peace
|
;;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()
|
;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap()
|
||||||
;; (scala +lsp) ; java, but good
|
;; (scala +lsp) ; java, but good
|
||||||
;;(scheme +guile) ; a fully conniving family of lisps
|
;;(scheme +guile) ; a fully conniving family of lisps
|
||||||
|
|||||||
18
packages.el
18
packages.el
@@ -58,7 +58,13 @@
|
|||||||
(package! org-inline-pdf)
|
(package! org-inline-pdf)
|
||||||
(package! org-clock-convenience)
|
(package! org-clock-convenience)
|
||||||
(package! org-super-agenda)
|
(package! org-super-agenda)
|
||||||
|
(package! org-caldav)
|
||||||
|
|
||||||
|
;;; Roam
|
||||||
|
;;
|
||||||
|
|
||||||
(package! org-transclusion)
|
(package! org-transclusion)
|
||||||
|
(package! org-remark)
|
||||||
|
|
||||||
;; org-roam-ui keeps up with the latest features in org-roam
|
;; org-roam-ui keeps up with the latest features in org-roam
|
||||||
(unpin! org-roam)
|
(unpin! org-roam)
|
||||||
@@ -70,28 +76,24 @@
|
|||||||
(package! jl-encrypt
|
(package! jl-encrypt
|
||||||
:recipe (:host gitlab :repo "lechten/defaultencrypt"))
|
:recipe (:host gitlab :repo "lechten/defaultencrypt"))
|
||||||
|
|
||||||
;; (package! mu4e-alert)
|
|
||||||
;; (package! clip2org)
|
;; (package! clip2org)
|
||||||
(package! centered-cursor-mode)
|
(package! centered-cursor-mode)
|
||||||
;; (package! counsel-tramp)
|
;; (package! counsel-tramp)
|
||||||
;; (package! org-capture-pop-frame)
|
|
||||||
(package! org-caldav)
|
|
||||||
(package! ob-typescript)
|
(package! ob-typescript)
|
||||||
(package! indium)
|
(package! indium)
|
||||||
;; (package! mac-pseudo-daemon)
|
;; (package! mac-pseudo-daemon)
|
||||||
;; (package! nix-docbook-mode)
|
;; (package! nix-docbook-mode)
|
||||||
(package! base16-theme)
|
|
||||||
(package! pdf-tools :built-in 'prefer)
|
(package! pdf-tools :built-in 'prefer)
|
||||||
(package! nov)
|
(package! nov)
|
||||||
;; (package! org-gtd)
|
;; (package! org-gtd)
|
||||||
;; (package! weblorg)
|
;; (package! weblorg)
|
||||||
|
(package! evil-escape :disable t)
|
||||||
(package! emacs-codeql
|
(package! emacs-codeql
|
||||||
:recipe (:host github
|
:recipe (:host github
|
||||||
:repo "anticomputer/emacs-codeql"
|
:repo "anticomputer/emacs-codeql"
|
||||||
:branch "main"
|
:branch "main"
|
||||||
:files (:defaults "bin")))
|
:files (:defaults "bin")))
|
||||||
|
|
||||||
;; https://github.com/doomemacs/doomemacs/issues/7196
|
(package! gptel)
|
||||||
(unpin! evil-collection)
|
(package! copilot
|
||||||
(package! evil-collection :recipe (:repo "emacs-evil/evil-collection" :branch "master"))
|
:recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el" "dist")))
|
||||||
|
|||||||
213
roam.el
Normal file
213
roam.el
Normal file
@@ -0,0 +1,213 @@
|
|||||||
|
;;; roam.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(after! org-roam
|
||||||
|
(setq org-roam-capture-templates
|
||||||
|
'(("d" "default" plain
|
||||||
|
"%?"
|
||||||
|
:target
|
||||||
|
(file+head
|
||||||
|
"pages/${slug}.org"
|
||||||
|
"#+title: ${title}\n")
|
||||||
|
:unnarrowed t)
|
||||||
|
))
|
||||||
|
(setq org-roam-dailies-capture-templates
|
||||||
|
'(("d" "default" entry
|
||||||
|
"* %?"
|
||||||
|
:target (file "%<%Y_%m_%d>.org"))))
|
||||||
|
;; "#+title: %<%Y-%m-%d>\n"))))
|
||||||
|
(map! :leader
|
||||||
|
:desc "Capture today" "n n" #'org-roam-dailies-capture-today)
|
||||||
|
|
||||||
|
(setq org-roam-capture-ref-templates
|
||||||
|
'(("r" "reference" plain
|
||||||
|
"%?"
|
||||||
|
:target
|
||||||
|
(file+head
|
||||||
|
"references/${slug}.org"
|
||||||
|
"#+title: ${title}")
|
||||||
|
:unnarrowed t)))
|
||||||
|
(setq org-roam-directory org-directory
|
||||||
|
;; compares a file relative to `org-roam-directory'
|
||||||
|
org-roam-file-exclude-regexp '("logseq")
|
||||||
|
org-roam-completion-everywhere nil
|
||||||
|
org-roam-dailies-directory "journals/"))
|
||||||
|
|
||||||
|
(setq org-download-image-dir (expand-file-name "assets" org-directory))
|
||||||
|
(use-package! org-download
|
||||||
|
:commands
|
||||||
|
org-download-dnd
|
||||||
|
org-download-yank
|
||||||
|
org-download-screenshot
|
||||||
|
org-download-clipboard
|
||||||
|
org-download-dnd-base64
|
||||||
|
:init
|
||||||
|
;; HACK We add these manually so that org-download is truly lazy-loaded
|
||||||
|
(pushnew! dnd-protocol-alist
|
||||||
|
'("^\\(?:https?\\|ftp\\|file\\|nfs\\):" . org-download-dnd)
|
||||||
|
'("^data:" . org-download-dnd-base64))
|
||||||
|
(advice-add #'org-download-enable :override #'ignore)
|
||||||
|
|
||||||
|
:config
|
||||||
|
(setq org-download-method 'directory
|
||||||
|
;; org-download-heading-lvl nil
|
||||||
|
org-download-timestamp "_%Y%m%d_%H%M%S"
|
||||||
|
org-download-annotate-function (lambda (_link) "")
|
||||||
|
org-download-screenshot-method "flameshot gui --raw > %s"))
|
||||||
|
;; org-download-abbreviate-filename-function
|
||||||
|
;; (lambda (path)
|
||||||
|
;; (if (file-in-directory-p path org-download-image-dir)
|
||||||
|
;; (file-relative-name path org-download-image-dir)
|
||||||
|
;; path)))
|
||||||
|
;; (after! org-download
|
||||||
|
;; (setq org-download-method 'directory
|
||||||
|
;; ;; org-download-heading-lvl nil
|
||||||
|
;; ;; org-download-timestamp "_%Y%m%d_%H%M%S"
|
||||||
|
;; org-download-screenshot-method "flameshot gui --raw > %s"))
|
||||||
|
|
||||||
|
(after! citar
|
||||||
|
;; (setq citar-file-parser-functions
|
||||||
|
;; '(citar-file--parser-default
|
||||||
|
;; citar-file--parser-triplet))
|
||||||
|
;; (setq citar-org-roam-capture-template-key "n")
|
||||||
|
(setq! citar-library-paths '("~/Zotero" "~/Nextcloud/Calibre")
|
||||||
|
citar-notes-paths (list (expand-file-name "references" org-roam-directory))
|
||||||
|
citar-bibliography (list (expand-file-name "library.bib" org-roam-directory)
|
||||||
|
(expand-file-name "books.bib" org-roam-directory))))
|
||||||
|
|
||||||
|
(after! citar-org-roam
|
||||||
|
;; (citar-register-notes-source
|
||||||
|
;; 'orb-citar-source (list :name "Org-Roam Notes"
|
||||||
|
;; :category 'org-roam-node
|
||||||
|
;; :items #'citar-org-roam--get-candidates
|
||||||
|
;; :hasitems #'citar-org-roam-has-notes
|
||||||
|
;; :open #'citar-org-roam-open-note
|
||||||
|
;; :create #'orb-citar-edit-note
|
||||||
|
;; :annotate #'citar-org-roam--annotate))
|
||||||
|
;; (setq citar-notes-source 'orb-citar-source)
|
||||||
|
(setq citar-org-roam-subdir "references"))
|
||||||
|
|
||||||
|
;; insert drawings from my RM2
|
||||||
|
(use-package! org-inline-pdf
|
||||||
|
:hook (org-mode . org-inline-pdf-mode))
|
||||||
|
|
||||||
|
(use-package! org-roam-ui
|
||||||
|
:after org-roam
|
||||||
|
:config
|
||||||
|
(setq org-roam-ui-sync-theme t
|
||||||
|
org-roam-ui-follow t
|
||||||
|
org-roam-ui-update-on-save t
|
||||||
|
org-roam-ui-open-on-start t))
|
||||||
|
|
||||||
|
(after! org-noter
|
||||||
|
;; (map! :map pdf-view-mode-map "i" nil)
|
||||||
|
;; (map! :map pdf-view-mode-map :gn "i" #'org-noter-insert-note)
|
||||||
|
(setq org-noter-always-create-frame nil))
|
||||||
|
|
||||||
|
(use-package! nov
|
||||||
|
:mode ("\\.epub\\'" . nov-mode))
|
||||||
|
|
||||||
|
(use-package! org-transclusion
|
||||||
|
:after org
|
||||||
|
:init
|
||||||
|
(map!
|
||||||
|
:map global-map "<f12>" #'org-transclusion-add
|
||||||
|
:leader
|
||||||
|
:prefix "n"
|
||||||
|
:desc "Org Transclusion Mode" "t" #'org-transclusion-mode))
|
||||||
|
|
||||||
|
(defun my/org-remark-notes-file-name-function ()
|
||||||
|
(cond ((buffer-file-name)
|
||||||
|
(let ((source-filename (org-remark-source-find-file-name)))
|
||||||
|
(when (and (stringp source-filename)
|
||||||
|
(file-exists-p source-filename))
|
||||||
|
(concat (file-name-sans-extension
|
||||||
|
(file-name-nondirectory source-filename))
|
||||||
|
"-notes.org"))))
|
||||||
|
((eq major-mode 'eww-mode)
|
||||||
|
(my/org-remark-eww--create-capture-note eww-data))))
|
||||||
|
|
||||||
|
(defun my/org-remark-eww--create-capture-note (info)
|
||||||
|
"Open or create org-roam node from `eww-data'."
|
||||||
|
;; (let* ((title (plist-get eww-data :title))
|
||||||
|
;; (ref (plist-get eww-data :url)))
|
||||||
|
(org-roam-capture-
|
||||||
|
;; :keys (plist-get info :template)
|
||||||
|
:node (org-roam-node-create :title (plist-get info :title))
|
||||||
|
:info (list :ref (plist-get info :url))
|
||||||
|
;; :body (plist-get info :body))
|
||||||
|
:templates '(("r" "reference" plain "%?"
|
||||||
|
:target (file+head "${slug}.org"
|
||||||
|
"#+title: ${title}")
|
||||||
|
:immediate-finish t
|
||||||
|
:unnarrowed t))))
|
||||||
|
|
||||||
|
|
||||||
|
;; :templates org-roam-capture-ref-templates))
|
||||||
|
;; (apply 'org-roam-capture-
|
||||||
|
;; :info (setq infoplist
|
||||||
|
;; ;; Add notetitle in case someone wants to use it in their
|
||||||
|
;; ;; capture template.
|
||||||
|
;; (plist-put infoplist :note-title notetitle))
|
||||||
|
;; :info (list )
|
||||||
|
;; :node (org-roam-node-create :title title)
|
||||||
|
;; :props '(:finalize find-file)
|
||||||
|
;; (if templatekey
|
||||||
|
;; (list :keys templatekey)
|
||||||
|
;; (list
|
||||||
|
;; :templates
|
||||||
|
;; '(("r" "reference" plain "%?" :if-new
|
||||||
|
;; (file+head
|
||||||
|
;; "%(concat
|
||||||
|
;; (when citar-org-roam-subdir (concat citar-org-roam-subdir \"/\")) \"${citar-citekey}.org\")"
|
||||||
|
;; "#+title: ${note-title}\n")
|
||||||
|
;; :immediate-finish t
|
||||||
|
;; :unnarrowed t)))))
|
||||||
|
;; (org-roam-ref-add url)))
|
||||||
|
|
||||||
|
;; (org-roam-capture-
|
||||||
|
;; :keys (plist-get info :template)
|
||||||
|
;; :node (org-roam-node-create :title (plist-get info :title))
|
||||||
|
;; :info (list :ref (plist-get info :ref)
|
||||||
|
;; :body (plist-get info :body))
|
||||||
|
;; :templates org-roam-capture-ref-templates))
|
||||||
|
|
||||||
|
;; (use-package! org-remark
|
||||||
|
;; :after org
|
||||||
|
;; :init
|
||||||
|
;; (require 'org-remark-global-tracking)
|
||||||
|
;; (org-remark-global-tracking-mode +1)
|
||||||
|
;; (map! "C-c n m" #'org-remark-mark)
|
||||||
|
;; :config
|
||||||
|
;; (map! :map org-remark-mode-map
|
||||||
|
;; "C-c n o" #'org-remark-open
|
||||||
|
;; "C-c n ]" #'org-remark-view-next
|
||||||
|
;; "C-c n [" #'org-remark-view-prev
|
||||||
|
;; "C-c n R" #'org-remark-remove))
|
||||||
|
|
||||||
|
(use-package! org-remark
|
||||||
|
:bind (;; :bind keyword also implicitly defers org-remark itself.
|
||||||
|
;; Keybindings before :map is set for global-map.
|
||||||
|
("C-c n m" . org-remark-mark)
|
||||||
|
("C-c n l" . org-remark-mark-line)
|
||||||
|
:map org-remark-mode-map
|
||||||
|
("C-c n o" . org-remark-open)
|
||||||
|
("C-c n ]" . org-remark-view-next)
|
||||||
|
("C-c n [" . org-remark-view-prev)
|
||||||
|
("C-c n r" . org-remark-remove)
|
||||||
|
("C-c n d" . org-remark-delete))
|
||||||
|
;; Alternative way to enable `org-remark-global-tracking-mode' in
|
||||||
|
;; `after-init-hook'.
|
||||||
|
;; :hook (after-init . org-remark-global-tracking-mode)
|
||||||
|
:init
|
||||||
|
;; It is recommended that `org-remark-global-tracking-mode' be
|
||||||
|
;; enabled when Emacs initializes. Alternatively, you can put it to
|
||||||
|
;; `after-init-hook' as in the comment above
|
||||||
|
(org-remark-global-tracking-mode +1)
|
||||||
|
:config
|
||||||
|
(setq org-remark-notes-file-name #'my/org-remark-notes-file-name-function)
|
||||||
|
(use-package org-remark-info :after info :config (org-remark-info-mode +1))
|
||||||
|
(use-package org-remark-eww :after eww :config (org-remark-eww-mode +1))
|
||||||
|
(use-package org-remark-nov :after nov :config (org-remark-nov-mode +1)))
|
||||||
|
|
||||||
|
(after! org-roam-bibtex
|
||||||
|
(setq orb-insert-link-description 'citekey))
|
||||||
Reference in New Issue
Block a user