diff --git a/modules/defuns/defuns-org.el b/modules/defuns/defuns-org.el index a963f497e..792a3d311 100644 --- a/modules/defuns/defuns-org.el +++ b/modules/defuns/defuns-org.el @@ -112,6 +112,16 @@ wrong places)." (delete-char 4)) (insert "[ ] "))))) +;;;###autoload +(defun doom/org-toggle-fold () + "Toggle the local fold at the point (as opposed to cycling through all levels +with `org-cycle')." + (interactive) + (cond ((org-at-heading-p) + (outline-toggle-children)) + ((org-at-item-p) + (org-cycle)))) + ;;;###autoload (defun doom/org-dwim-at-point () "Do-what-I-mean at point. This includes following timestamp links, aligning diff --git a/modules/module-org.el b/modules/module-org.el index bc5ebf3f0..eed0c2995 100644 --- a/modules/module-org.el +++ b/modules/module-org.el @@ -77,6 +77,7 @@ system can keep track of each buffer's attachments.") org-export-coding-system 'utf-8 ;; Appearance + outline-blank-line t org-indent-mode-turns-on-hiding-stars t org-adapt-indentation nil org-blank-before-new-entry '((heading . nil) (plain-list-item . auto)) @@ -237,6 +238,8 @@ system can keep track of each buffer's attachments.") :i [(shift tab)] 'doom/org-dedent-or-prev-field :i [backtab] 'doom/org-dedent-or-prev-field + :n "" 'doom/org-toggle-fold + :nv "j" 'evil-next-visual-line :nv "k" 'evil-previous-visual-line :v "" 'doom/yas-insert-snippet @@ -284,7 +287,7 @@ system can keep track of each buffer's attachments.") :n "x" 'doom/org-remove-link) ;; TODO Improve folding bindings - :n "za" 'org-cycle + :n "za" 'doom/org-toggle-fold :n "zA" 'org-shifttab :n "zc" 'outline-hide-subtree :n "zC" (λ! (outline-hide-sublevels 1))