diff --git a/config.org b/config.org index 3dde12d..f3f9d80 100644 --- a/config.org +++ b/config.org @@ -797,6 +797,14 @@ Set up habit display. (add-to-list 'org-modules 'org-habit t) (setq org-habit-show-all-today t) #+END_SRC + +*** Refile + +#+BEGIN_SRC emacs-lisp + (when (string-equal system-type "gnu/linux") + ;; (setq org-refile-targets `((,(directory-files-recursively "~/Documents/drive/org/journal/" "\\.org$") :maxlevel . 1))) + (setq org-refile-use-outline-path 'file)) +#+END_SRC ** =paren= Highlights matching bracket. diff --git a/custom/refile.el b/custom/refile.el new file mode 100644 index 0000000..f77abf8 --- /dev/null +++ b/custom/refile.el @@ -0,0 +1,20 @@ +(defun filejournal () + "Refile heading to specific file based on heading" + (interactive) + (setq orgheading (org-get-heading)) + (setq orgyear (substring orgheading 0 4)) + (setq orgmonth (substring orgheading 5 7)) + (setq orgfilepath (concat "~/Documents/drive/org/journal/" orgyear "/" orgmonth "/" orgheading ".org")) + (org-edit-headline "journal") + (let ((org-refile-targets '((orgfilepath :maxlevel . 1)))) + (org-refile))) + +(defun filedate () + "Insert timestamp based on file name" + (interactive) + (goto-char (point-min)) + (setq thedate (file-name-base)) + (insert (concat "<" thedate ">")) + (org-ctrl-c-ctrl-c) + (insert "\n\n") + (goto-char (point-min)))