From 12a45ed76772e3be3af68a646cc5d13f3456a056 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Thu, 26 Aug 2021 11:39:33 -0400 Subject: [PATCH] ADD last headline nav function --- etc/conf.org | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/etc/conf.org b/etc/conf.org index 43aae7d..6c27bd7 100644 --- a/etc/conf.org +++ b/etc/conf.org @@ -1958,6 +1958,26 @@ Set org columns view to be more informative with clocksums and effort. (set-face-attribute 'org-column nil :background "#1e2023") #+END_SRC +*** navigation +:PROPERTIES: +:CREATED: [2021-08-26 Thu 11:21] +:END: +Some common functions that I use often that don't seem to exist +#+begin_src emacs-lisp +(defun nd/org-goto-last-child-headline () + "Go to the last child headline under the current headline." + (interactive) + (-if-let (level (-some->> (org-ml-parse-this-headline) + (org-ml-get-property :level) + (1+))) + (progn + (org-show-children) + (org-end-of-subtree) + (org-back-to-heading) + (while (< level (org-current-level)) + (org-up-heading-safe))) + (message "Not on a headline"))) +#+end_src ** calfw :PROPERTIES: :ID: 57d3105c-eab1-4784-ab27-cf63e6c56b05 @@ -3802,6 +3822,10 @@ Some of these commands just get in the way of being evil (which really means tha (add-hook 'org-mode-hook 'evil-org-mode) (add-hook 'evil-org-mode-hook 'evil-org-set-key-theme) + + (evil-define-key 'normal org-mode-map + "g]" #'nd/org-goto-last-child-headline) + (require 'evil-org-agenda) (evil-org-agenda-set-keys) ;; some of the defaults bug me...