Compare commits
12 Commits
6951ffc0c3
...
c4b861996f
Author | SHA1 | Date | |
---|---|---|---|
c4b861996f | |||
ad762f9e92 | |||
70e56bfbaf | |||
05dd325fda | |||
e168ba24b3 | |||
1de6abe136 | |||
655b40956b | |||
5c37f99702 | |||
07c8e15411 | |||
24f8d78e58 | |||
ec3c516deb | |||
154a5faebe |
95
config.el
95
config.el
@ -227,67 +227,6 @@
|
||||
(map! :map Info-mode-map
|
||||
: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)
|
||||
;; )
|
||||
|
||||
(after! biblio
|
||||
(map! :map biblio-selection-mode-map
|
||||
@ -397,6 +336,10 @@
|
||||
|
||||
(setq +latex-viewers '(pdf-tools))
|
||||
|
||||
(after! eww
|
||||
(setq eww-auto-rename-buffer 'title))
|
||||
|
||||
|
||||
;; (setq! +biblio-pdf-library-dir "~/Nextcloud/Papers/"
|
||||
;; +biblio-default-bibliography-files '("~/Nextcloud/Papers/library.bib")
|
||||
;; +biblio-notes-path org-roam-directory)
|
||||
@ -468,7 +411,35 @@
|
||||
:before #'server-edit
|
||||
(save-buffer))
|
||||
|
||||
(use-package! gptel
|
||||
:config
|
||||
(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/")
|
||||
|
||||
;; C-k is mapped to ~org-element-up~ by default
|
||||
(map! :after org
|
||||
:map evil-org-mode-map
|
||||
:i "C-k" #'org-kill-line)
|
||||
|
||||
(map! :after org
|
||||
:map org-mode-map
|
||||
:localleader
|
||||
"Y" #'ox-clip-image-to-clipboard)
|
||||
|
||||
;; load personal modules
|
||||
(load! "org")
|
||||
;; (load! "org")
|
||||
(load! "gtd")
|
||||
(load! "roam")
|
||||
(load! "email")
|
||||
|
60
email.el
60
email.el
@ -1,15 +1,19 @@
|
||||
;;; email.el -*- lexical-binding: t; -*-
|
||||
|
||||
(after! mu4e
|
||||
;; Recommended msmtp config from doom module documentation
|
||||
(setq sendmail-program (executable-find "msmtp")
|
||||
;; Start mu4e in the background
|
||||
;; https://github.com/djcb/mu/issues/2282
|
||||
(require 'mu4e)
|
||||
(mu4e 'background)
|
||||
|
||||
;; Recommended msmtp config from doom module documentation
|
||||
(setq sendmail-program (executable-find "msmtp")
|
||||
send-mail-function #'smtpmail-send-it
|
||||
message-sendmail-f-is-evil t
|
||||
message-sendmail-extra-arguments '("--read-envelope-from")
|
||||
message-send-mail-function #'message-send-mail-with-sendmail)
|
||||
|
||||
;; `set-email-account!' doesn't accept a custom match-func
|
||||
(setq mu4e-contexts
|
||||
;; `set-email-account!' doesn't accept a custom match-func
|
||||
(setq mu4e-contexts
|
||||
(list
|
||||
;; (make-mu4e-context
|
||||
;; :name "upcycling"
|
||||
@ -43,7 +47,7 @@
|
||||
("maxsc@fsfe.org"))
|
||||
))))
|
||||
|
||||
(setq mu4e-attachment-dir "~/Downloads"
|
||||
(setq mu4e-attachment-dir "~/Downloads"
|
||||
mu4e-sent-folder "/mailbox/Sent"
|
||||
mu4e-drafts-folder "/mailbox/Drafts"
|
||||
mu4e-trash-folder "/mailbox/Trash"
|
||||
@ -75,16 +79,21 @@
|
||||
:hide-unread t
|
||||
:key ?t)))
|
||||
|
||||
;; Render buttons to verify&decrypt messages
|
||||
(setq mm-decrypt-option 'always
|
||||
;; 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
|
||||
(setq mm-decrypt-option 'always
|
||||
mm-verify-option 'always
|
||||
gnus-buttonized-mime-types '("multipart/encrypted" "multipart/signed")
|
||||
mml-secure-openpgp-encrypt-to-self t)
|
||||
|
||||
;; Move message to the trash folder but do not set the trash flag
|
||||
;; https://github.com/djcb/mu/issues/1136#issuecomment-1066303788
|
||||
(setf (alist-get 'trash mu4e-marks)
|
||||
(list :char '("d" . "▼")
|
||||
;; Move message to the trash folder but do not set the trash flag
|
||||
;; https://github.com/djcb/mu/issues/1136#issuecomment-1066303788
|
||||
(setf (alist-get 'trash mu4e-marks)
|
||||
(list :char '("d" . "▼")
|
||||
:prompt "dtrash"
|
||||
:dyn-target (lambda (target msg)
|
||||
(mu4e-get-trash-folder msg))
|
||||
@ -94,7 +103,7 @@
|
||||
;; IMAP-deleted:
|
||||
(mu4e--server-move docid (mu4e--mark-check-target target) "+S-u-N"))))
|
||||
|
||||
(add-to-list 'mu4e-marks
|
||||
(add-to-list 'mu4e-marks
|
||||
'(spam
|
||||
:char "S"
|
||||
:prompt "Spam"
|
||||
@ -102,14 +111,14 @@
|
||||
:action (lambda (docid msg target)
|
||||
(mu4e--server-move docid mu4e-spam-folder "+S-u-N"))))
|
||||
|
||||
(defun my:mu4e-mark-for-spam()
|
||||
(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)
|
||||
(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"
|
||||
:handler (lambda (file)
|
||||
(shell-command
|
||||
@ -117,11 +126,10 @@
|
||||
(khalel-import-events))
|
||||
:receives temp))
|
||||
|
||||
;; Sign sent email automatically
|
||||
;; (add-hook 'message-send-hook 'mml-secure-message-sign-smime)
|
||||
;; Sign sent email automatically
|
||||
;; (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)
|
||||
;; (let* ((att (mu4e~view-get-attach msg attnum))
|
||||
@ -139,17 +147,7 @@
|
||||
;; (add-to-list 'mu4e-view-attachment-actions
|
||||
;; '("cImport in calendar" . max/mu4e-view-import-attachment-calendar) t)
|
||||
|
||||
;; Autoload this command so that the mbsync service can update the index
|
||||
(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)
|
||||
(map! "<f2>" #'=mu4e)
|
||||
|
||||
(after! epa
|
||||
(setq epa-keyserver "keys.openpgp.org")
|
||||
|
89
gtd.el
89
gtd.el
@ -6,8 +6,8 @@
|
||||
org-agenda-files (mapcar (lambda (filename) (expand-file-name filename org-directory))
|
||||
'("gtd/inbox.org"
|
||||
"gtd/tasks.org"
|
||||
"gtd/journal.org"
|
||||
"gtd/calendar.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
|
||||
;; (file-expand-wildcards (concat org-directory "gtd/*.org")))
|
||||
@ -184,11 +184,16 @@ the current import date range."
|
||||
:config
|
||||
(advice-add #'khalel--insert-import-file-header :override #'max/khalel--insert-import-file-header)
|
||||
(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"
|
||||
khalel-import-org-file-confirm-overwrite nil
|
||||
khalel-import-start-date "-15d"
|
||||
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\
|
||||
:PROPERTIES:\n:CALENDAR: {calendar}\n\
|
||||
:LOCATION: {location}\n\
|
||||
@ -221,6 +226,54 @@ show up there.\n\n"))
|
||||
|
||||
(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
|
||||
(setq org-clock-persist t
|
||||
;; Useful when clocking in on a waiting task
|
||||
@ -244,7 +297,29 @@ show up there.\n\n"))
|
||||
org-pomodoro-short-break-length 5
|
||||
org-pomodoro-long-break-length 20))
|
||||
|
||||
;;
|
||||
;;; Reference system
|
||||
|
||||
(load! "roam")
|
||||
(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)))))
|
||||
|
52
org.el
52
org.el
@ -1,52 +0,0 @@
|
||||
;;; 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)
|
||||
|
||||
(defvar org-clock-heading-str-limit 20
|
||||
"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-string-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
|
||||
work-done-str
|
||||
current-work-done-str)))))
|
||||
|
||||
;; 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
|
||||
"Y" #'ox-clip-image-to-clipboard)
|
18
packages.el
18
packages.el
@ -58,7 +58,13 @@
|
||||
(package! org-inline-pdf)
|
||||
(package! org-clock-convenience)
|
||||
(package! org-super-agenda)
|
||||
(package! org-caldav)
|
||||
|
||||
;;; Roam
|
||||
;;
|
||||
|
||||
(package! org-transclusion)
|
||||
(package! org-remark)
|
||||
|
||||
;; org-roam-ui keeps up with the latest features in org-roam
|
||||
(unpin! org-roam)
|
||||
@ -70,19 +76,13 @@
|
||||
(package! jl-encrypt
|
||||
:recipe (:host gitlab :repo "lechten/defaultencrypt"))
|
||||
|
||||
;; (package! mu4e-alert)
|
||||
;; (package! clip2org)
|
||||
(package! centered-cursor-mode)
|
||||
;; (package! counsel-tramp)
|
||||
;; (package! org-capture-pop-frame)
|
||||
(package! org-caldav)
|
||||
;; XXX https://github.com/alphapapa/org-protocol-capture-html/issues/40
|
||||
;; (package! org-protocol-capture-html)
|
||||
(package! ob-typescript)
|
||||
(package! indium)
|
||||
;; (package! mac-pseudo-daemon)
|
||||
;; (package! nix-docbook-mode)
|
||||
(package! base16-theme)
|
||||
(package! pdf-tools :built-in 'prefer)
|
||||
(package! nov)
|
||||
;; (package! org-gtd)
|
||||
@ -94,6 +94,6 @@
|
||||
:branch "main"
|
||||
:files (:defaults "bin")))
|
||||
|
||||
;; https://github.com/doomemacs/doomemacs/issues/7196
|
||||
(unpin! evil-collection)
|
||||
(package! evil-collection :recipe (:repo "emacs-evil/evil-collection" :branch "master"))
|
||||
(package! gptel)
|
||||
(package! copilot
|
||||
:recipe (:host github :repo "copilot-emacs/copilot.el" :files ("*.el" "dist")))
|
||||
|
191
roam.el
191
roam.el
@ -2,64 +2,77 @@
|
||||
|
||||
(after! org-roam
|
||||
(setq org-roam-capture-templates
|
||||
'(("m" "main" plain
|
||||
'(("d" "default" plain
|
||||
"%?"
|
||||
:target
|
||||
(file+head
|
||||
"main/${slug}.org"
|
||||
"pages/${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
|
||||
"%?"
|
||||
: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"))))
|
||||
: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-directory (concat org-directory "roam/")
|
||||
org-roam-completion-everywhere nil))
|
||||
|
||||
(after! org-download
|
||||
(setq org-download-screenshot-method "flameshot gui --raw > %s"))
|
||||
(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-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))))
|
||||
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
|
||||
@ -71,7 +84,7 @@
|
||||
;; :create #'orb-citar-edit-note
|
||||
;; :annotate #'citar-org-roam--annotate))
|
||||
;; (setq citar-notes-source 'orb-citar-source)
|
||||
(setq citar-org-roam-subdir "reference"))
|
||||
(setq citar-org-roam-subdir "references"))
|
||||
|
||||
;; insert drawings from my RM2
|
||||
(use-package! org-inline-pdf
|
||||
@ -102,5 +115,99 @@
|
||||
: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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user