mirror of
http://github.com/JaeUs3792/dotfiles
synced 2025-12-14 08:01:35 +09:00
Emacs : capture
This commit is contained in:
@ -787,7 +787,7 @@ Quick Action in minibuffer
|
|||||||
|
|
||||||
**** Corfu / Cape
|
**** Corfu / Cape
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-completion.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-completion.el
|
||||||
;;; Corfu
|
;;; Corfu
|
||||||
(use-package corfu
|
(use-package corfu
|
||||||
:custom
|
:custom
|
||||||
(corfu-cycle t) ;; Enable cycling for `corfu-next/previous'
|
(corfu-cycle t) ;; Enable cycling for `corfu-next/previous'
|
||||||
@ -816,7 +816,7 @@ Quick Action in minibuffer
|
|||||||
(define-key corfu-map (kbd "M-n") #'corfu-popupinfo-scroll-up)
|
(define-key corfu-map (kbd "M-n") #'corfu-popupinfo-scroll-up)
|
||||||
(define-key corfu-map (kbd "M-d") #'corfu-popupinfo-toggle)
|
(define-key corfu-map (kbd "M-d") #'corfu-popupinfo-toggle)
|
||||||
|
|
||||||
;;; Cape
|
;;; Cape
|
||||||
;; Setup Cape for better completion-at-point support and more
|
;; Setup Cape for better completion-at-point support and more
|
||||||
(use-package cape
|
(use-package cape
|
||||||
:config
|
:config
|
||||||
@ -835,6 +835,8 @@ Quick Action in minibuffer
|
|||||||
corfu-quit-no-match t
|
corfu-quit-no-match t
|
||||||
corfu-auto nil)
|
corfu-auto nil)
|
||||||
(corfu-mode))))
|
(corfu-mode))))
|
||||||
|
(unless (package-installed-p 'corfu-terminal)
|
||||||
|
(package-install 'corfu-terminal))
|
||||||
(unless (display-graphic-p)
|
(unless (display-graphic-p)
|
||||||
(require 'corfu-terminal)
|
(require 'corfu-terminal)
|
||||||
(corfu-terminal-mode +1))
|
(corfu-terminal-mode +1))
|
||||||
@ -1181,17 +1183,30 @@ latex export code block
|
|||||||
(setq org-journal-file-type 'weekly))
|
(setq org-journal-file-type 'weekly))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
|
***** Org Agenda
|
||||||
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-org.el
|
||||||
|
(defvar my/org-agenda-default-file "~/org/agenda/agenda.org")
|
||||||
|
(setq org-agenda-files (list my/org-agenda-default-file))
|
||||||
|
#+end_src
|
||||||
***** Org Roam
|
***** Org Roam
|
||||||
+ TODO: Project todos
|
+ TODO: Project todos
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-org.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-org.el
|
||||||
(use-package org-roam
|
(use-package org-roam
|
||||||
|
;;:demand t ;; ensure org-roam is loaded by default
|
||||||
:custom
|
:custom
|
||||||
(org-roam-directory "~/org/roam")
|
(org-roam-directory "~/org/roam")
|
||||||
(org-roam-node-display-template (concat "${title:*} " (propertize "${tags:*}" 'face 'org-tag)))
|
(org-roam-node-display-template (concat "${title:*} " (propertize "${tags:*}" 'face 'org-tag)))
|
||||||
;;(org-roam-completion-everywhere t)
|
;;(org-roam-completion-everywhere t)
|
||||||
:config
|
:config
|
||||||
|
(setq org-roam-capture-templates '(("d" "default" plain "%?"
|
||||||
|
:target (file+head "${slug}.org"
|
||||||
|
"#+title: ${title}\n")
|
||||||
|
:unnarrowed t)
|
||||||
|
("p" "project" plain "* TODO %?"
|
||||||
|
:target (file+head+olp "%<%Y%m%d%H%M%S>-${slug}.org"
|
||||||
|
"#+title: ${title}\n#+category: ${title}\n#+filetags: Project"
|
||||||
|
("Tasks")))))
|
||||||
(org-roam-db-autosync-mode))
|
(org-roam-db-autosync-mode))
|
||||||
;;(my/org-roam-refresh-agenda-list)
|
|
||||||
;; Org roam ui
|
;; Org roam ui
|
||||||
(use-package org-roam-ui
|
(use-package org-roam-ui
|
||||||
:defer t
|
:defer t
|
||||||
@ -1209,13 +1224,6 @@ latex export code block
|
|||||||
(interactive)
|
(interactive)
|
||||||
(let ((consult-ripgrep-command "rg --null --ignore-case --type org --line-buffered --color=always --max-columns=500 --no-heading --line-number . -e ARG OPTS"))
|
(let ((consult-ripgrep-command "rg --null --ignore-case --type org --line-buffered --color=always --max-columns=500 --no-heading --line-number . -e ARG OPTS"))
|
||||||
(consult-ripgrep org-roam-directory)))
|
(consult-ripgrep org-roam-directory)))
|
||||||
(defun my/org-roam-node-insert-with-capture (arg &rest args)
|
|
||||||
"Org roam insert node with capture templates"
|
|
||||||
(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)))
|
|
||||||
(defun my/org-roam-filter-by-tag (tag-name)
|
(defun my/org-roam-filter-by-tag (tag-name)
|
||||||
(lambda (node)
|
(lambda (node)
|
||||||
(member tag-name (org-roam-node-tags node))))
|
(member tag-name (org-roam-node-tags node))))
|
||||||
@ -1226,10 +1234,11 @@ latex export code block
|
|||||||
(org-roam-node-list))))
|
(org-roam-node-list))))
|
||||||
(defun my/org-roam-refresh-agenda-list ()
|
(defun my/org-roam-refresh-agenda-list ()
|
||||||
(interactive)
|
(interactive)
|
||||||
(setq org-agenda-files (my/org-roam-list-notes-by-tag "Project")))
|
(setq org-agenda-files (my/org-roam-list-notes-by-tag "Project"))
|
||||||
|
(add-to-list 'org-agenda-files my/org-agenda-default-file))
|
||||||
(defun my/org-roam-project-finalize-hook ()
|
(defun my/org-roam-project-finalize-hook ()
|
||||||
"Adds the captured project file to `org-agenda-files' if the
|
"Adds the captured project file to `org-agenda-files' if the
|
||||||
capture was not aborted."
|
capture was not aborted."
|
||||||
;; Remove the hook since it was added temporarily
|
;; Remove the hook since it was added temporarily
|
||||||
(remove-hook 'org-capture-after-finalize-hook #'my/org-roam-project-finalize-hook)
|
(remove-hook 'org-capture-after-finalize-hook #'my/org-roam-project-finalize-hook)
|
||||||
|
|
||||||
@ -1237,7 +1246,6 @@ latex export code block
|
|||||||
(unless org-note-abort
|
(unless org-note-abort
|
||||||
(with-current-buffer (org-capture-get :buffer)
|
(with-current-buffer (org-capture-get :buffer)
|
||||||
(add-to-list 'org-agenda-files (buffer-file-name)))))
|
(add-to-list 'org-agenda-files (buffer-file-name)))))
|
||||||
|
|
||||||
(defun my/org-roam-find-project ()
|
(defun my/org-roam-find-project ()
|
||||||
(interactive)
|
(interactive)
|
||||||
;; Add the project file to the agenda after capture is finished
|
;; Add the project file to the agenda after capture is finished
|
||||||
@ -1252,12 +1260,22 @@ latex export code block
|
|||||||
'(("p" "project" plain "* Goals\n\n%?\n\n* Tasks\n\n** TODO Add initial tasks\n\n* History\n\n* Notes\n\n"
|
'(("p" "project" plain "* Goals\n\n%?\n\n* Tasks\n\n** TODO Add initial tasks\n\n* History\n\n* Notes\n\n"
|
||||||
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n#+category: ${title}\n#+filetags: Project")
|
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n#+category: ${title}\n#+filetags: Project")
|
||||||
:unnarrowed t))))
|
:unnarrowed t))))
|
||||||
|
(defun my/org-roam-capture-task ()
|
||||||
|
(interactive)
|
||||||
|
;; Add the project file to the agenda after capture is finished
|
||||||
|
;;(add-hook 'org-capture-after-finalize-hook #'my/org-roam-project-finalize-hook)
|
||||||
|
|
||||||
|
;; Capture the new task, creating the project file if necessary
|
||||||
|
(org-roam-capture- :node (org-roam-node-read
|
||||||
|
nil
|
||||||
|
(my/org-roam-filter-by-tag "Project"))
|
||||||
|
:templates '(("p" "project" plain "* TODO %?"
|
||||||
|
:if-new (file+head+olp "%<%Y%m%d%H%M%S>-${slug}.org"
|
||||||
|
"#+title: ${title}\n#+category: ${title}\n#+filetags: Project"
|
||||||
|
("Tasks"))))))
|
||||||
|
(my/org-roam-refresh-agenda-list)
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
***** Org Agenda
|
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-org.el
|
|
||||||
(setq org-agenda-files (list "~/org/agenda/agenda.org"))
|
|
||||||
#+end_src
|
|
||||||
***** Org Super Agenda
|
***** Org Super Agenda
|
||||||
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-org.el
|
#+begin_src emacs-lisp :mkdirp yes :tangle ~/.config/emacs/modules/custom-org.el
|
||||||
(use-package org-super-agenda
|
(use-package org-super-agenda
|
||||||
|
|||||||
Reference in New Issue
Block a user