Add mostalive library with org-roam immediate node
This commit is contained in:
@@ -40,18 +40,6 @@
|
|||||||
; (define-key org-roam-mode-map [mouse-1] #'org-roam-visit-thing)
|
; (define-key org-roam-mode-map [mouse-1] #'org-roam-visit-thing)
|
||||||
|
|
||||||
(require 'org-roam)
|
(require 'org-roam)
|
||||||
;; make sure that org-timer works and org-pomodoro therefore. Limit the number of agenda files searched
|
|
||||||
;; plus a utility function for flattening, since that is not part of the standard library of emacs
|
|
||||||
(setq org-agenda-files
|
|
||||||
(seq-map
|
|
||||||
'car
|
|
||||||
(org-roam-db-query
|
|
||||||
[:select
|
|
||||||
[file]
|
|
||||||
:from files
|
|
||||||
:where (like file "%daily\/2023%")
|
|
||||||
:order-by (desc file)
|
|
||||||
:limit 10])))
|
|
||||||
|
|
||||||
;; fix pdflatex for pdf export
|
;; fix pdflatex for pdf export
|
||||||
(setenv "PATH" (concat (getenv "PATH") ":/Library/TeX/texbin"))
|
(setenv "PATH" (concat (getenv "PATH") ":/Library/TeX/texbin"))
|
||||||
@@ -207,6 +195,7 @@
|
|||||||
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
|
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
|
||||||
;; they are implemented.
|
;; they are implemented.
|
||||||
|
|
||||||
|
|
||||||
;; configure git-delta
|
;; configure git-delta
|
||||||
(after! magit (magit-delta-mode +1))
|
(after! magit (magit-delta-mode +1))
|
||||||
;; HACK: disable diff-hl in magit - it appears to work ok inside files, but not in magit
|
;; HACK: disable diff-hl in magit - it appears to work ok inside files, but not in magit
|
||||||
@@ -215,6 +204,8 @@
|
|||||||
(after!
|
(after!
|
||||||
(magit) (remove-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh))
|
(magit) (remove-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;; from hlissner https://github.com/hlissner/.doom.d/blob/2529bcd46c5aad0cbe796793e5c08e1faf5ba272/config.el#L59-L65
|
;; from hlissner https://github.com/hlissner/.doom.d/blob/2529bcd46c5aad0cbe796793e5c08e1faf5ba272/config.el#L59-L65
|
||||||
;; disable auto-complete
|
;; disable auto-complete
|
||||||
(after! company
|
(after! company
|
||||||
@@ -391,6 +382,14 @@ the description. This may destroy existing links, or change their targets so use
|
|||||||
;; (ert "refactor.*")
|
;; (ert "refactor.*")
|
||||||
|
|
||||||
;; craft of emacs
|
;; craft of emacs
|
||||||
(add-load-path! "coe-xx")
|
(add-load-path! "~/.doom.d/coe-xx")
|
||||||
(require 'coe-xx)
|
(require 'coe-xx)
|
||||||
(require 'coe-demo)
|
(require 'coe-demo)
|
||||||
|
|
||||||
|
(add-load-path! "~/.doom.d/mostalive")
|
||||||
|
(require 'my-org-roam)
|
||||||
|
|
||||||
|
;; org-roam v1 port to v2, insert node without opening buffer
|
||||||
|
(map! :leader
|
||||||
|
:desc "Insert node immediate, don't open buffer on new node"
|
||||||
|
"n r I" #'org-roam-node-insert-immediate)
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
;;; mostalive/my-org-roam.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(provide 'my-org-roam)
|
||||||
|
;; Insert a link to a node, don't go to buffer when the node is new.
|
||||||
|
(defun org-roam-node-insert-immediate (arg &rest args)
|
||||||
|
(interactive "P")
|
||||||
|
(let ((args (push arg args))
|
||||||
|
(org-roam-capture-templates
|
||||||
|
(list
|
||||||
|
(append (car org-roam-capture-templates) '(:immediate-finish t)))))
|
||||||
|
(apply #'org-roam-node-insert args)))
|
||||||
|
|
||||||
|
|
||||||
|
;; make sure that org-timer works and org-pomodoro therefore. Limit the number of agenda files searched
|
||||||
|
;; plus a utility function for flattening, since that is not part of the standard library of emacs
|
||||||
|
|
||||||
|
(defun org-roam-collect-org-agenda-files ()
|
||||||
|
(interactive)
|
||||||
|
(collect-org-agenda-files-))
|
||||||
|
|
||||||
|
(defun collect-org-agenda-files- ()
|
||||||
|
(seq-map
|
||||||
|
'car
|
||||||
|
(org-roam-db-query
|
||||||
|
[:select
|
||||||
|
[file]
|
||||||
|
:from files
|
||||||
|
:where (like file "%daily\/2023%")
|
||||||
|
:order-by (desc file)
|
||||||
|
:limit 20])))
|
||||||
|
|
||||||
|
(setq org-agenda-files (collect-org-agenda-files-))
|
||||||
Reference in New Issue
Block a user