Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; not the first iteration, but since =, i h= and =, i s= didn't work and inserting a subitem above doesn't make sense I made the capitalized versions insert a todo
- ;; we can just rely upon =, s j= to move a heading up if need be
- (defun my-org-insert-subheading (arg)
- "Insert a new subheading and demote it.
- Works for outline headings and for plain lists alike."
- (interactive "P")
- (evil-org-end-of-line) ;; go to end of line first
- (org-insert-heading arg)
- (cond
- ((org-at-heading-p) (org-do-demote))
- ((org-at-item-p) (org-indent-item))))
- (defun my-org-insert-todo-subheading (arg)
- "Insert a new subheading with TODO keyword or checkbox and demote it.
- Works for outline headings and for plain lists alike."
- (interactive "P")
- (evil-org-end-of-line) ;; go to end of line first
- (org-insert-todo-heading arg)
- (cond
- ((org-at-heading-p) (org-do-demote))
- ((org-at-item-p) (org-indent-item))))
- (spacemacs/set-leader-keys-for-major-mode 'org-mode "is" 'my-org-insert-subheading)
- (spacemacs/set-leader-keys-for-major-mode 'org-mode "iS" 'my-org-insert-todo-subheading)
- ;; introduce same parity for normal headings
- ;; "ih" is already working org-insert-heading
- (spacemacs/set-leader-keys-for-major-mode 'org-mode "ih" 'org-insert-heading-after-current)
- (spacemacs/set-leader-keys-for-major-mode 'org-mode "iH" 'evil-org-org-insert-todo-heading-respect-content-below)
Add Comment
Please, Sign In to add comment