mirror of
https://codeberg.org/scip/dot-emacs.git
synced 2025-12-16 20:10:58 +01:00
fixed demoting and promoting with c-left|right
This commit is contained in:
@@ -91,6 +91,21 @@ down and unfold it, otherwise jump paragraph as usual."
|
||||
(org-cycle))
|
||||
(forward-paragraph)))
|
||||
|
||||
;; TODO: implement c-<left+right> to demote+promote again
|
||||
(defun tvd-org-demote-heading()
|
||||
"Demote heading if on a heading."
|
||||
(interactive)
|
||||
(if (org-at-heading-p)
|
||||
(org-demote-subtree)
|
||||
(call-interactively 'right-word)))
|
||||
|
||||
(defun tvd-org-promote-heading()
|
||||
"Promote heading if on a heading."
|
||||
(interactive)
|
||||
(if (org-at-heading-p)
|
||||
(org-promote-subtree)
|
||||
(call-interactively 'left-word)))
|
||||
|
||||
;; org-mode specific config, after load
|
||||
(eval-after-load "org"
|
||||
'(progn
|
||||
@@ -177,7 +192,8 @@ down and unfold it, otherwise jump paragraph as usual."
|
||||
(local-set-key (kbd "<C-down>") 'tvd-org-heading-down)
|
||||
|
||||
;; move word left or heading up, depending where point is
|
||||
(local-set-key (kbd "<C-left>") 'tvd-org-left-or-level-up)
|
||||
(local-set-key (kbd "<C-right>") 'tvd-org-demote-heading)
|
||||
(local-set-key (kbd "<C-left>") 'tvd-org-promote-heading)
|
||||
|
||||
;; use nicer bullets
|
||||
(when (fboundp 'org-bullets-mode)
|
||||
|
||||
Reference in New Issue
Block a user