From 0c91351414674bd2872aa1cc6f14b3115a674668 Mon Sep 17 00:00:00 2001 From: Dimitri Lozeve Date: Tue, 9 Nov 2021 16:39:30 +0100 Subject: [PATCH] Add org refile config option and utility function --- init.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/init.el b/init.el index 0cca66c..20a110d 100644 --- a/init.el +++ b/init.el @@ -65,6 +65,14 @@ (let ((fill-column (point-max))) (fill-region (region-beginning) (region-end) nil))) +(defun random-todo () + (interactive) + (let ((points nil)) + (goto-char (point-min)) + (while (search-forward-regexp "\*\sTODO" nil t) + (setq points (cons (1+ (match-end 0)) points))) + (goto-char (seq-random-elt points)))) + ;; Straight.el setup (setq straight-repository-branch "develop") (defvar bootstrap-version) @@ -561,6 +569,8 @@ (setq org-startup-folded nil) ;; Only one empty line is enough to separate headings when folded (setq org-cycle-separator-lines 1) + ;; Refile to paths in the file (level1/level2/level3) + (setq org-refile-use-outline-path t) (add-hook 'org-mode-hook #'visual-line-mode)