diff options
-rw-r--r-- | lisp/init-org.el | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lisp/init-org.el b/lisp/init-org.el index 276d6e1..594227d 100644 --- a/lisp/init-org.el +++ b/lisp/init-org.el @@ -83,6 +83,7 @@ 'km/org-tree-to-indirect-buffer-current-window) (define-key org-mode-map (kbd "C-c m w") 'km/org-refile-to-other-org-buffer) (define-key org-mode-map (kbd "C-c m s") 'km/org-sort-parent) + (define-key org-mode-map (kbd "C-c m l") 'km/org-remove-title-leader) ;; Override global `imenu' binding. (define-key org-mode-map (kbd "C-c j") 'org-goto) ;; Don't let `org-cycle-agenda-files' binding override custom @@ -155,6 +156,25 @@ under the current heading." (mapconcat 'identity heading-words " ")) nil)) +(defun km/org-remove-title-leader () + "Remove leader from Org heading title. + +Convert + + * TODO leader: Rest of title :tag: + +to + + * TODO Rest of title :tag:" + (interactive) + (save-excursion + (let ((regex (format "^%s\\(?:%s \\)?\\(.*: \\)\\w+" + org-outline-regexp org-todo-regexp))) + (org-back-to-heading) + (when (re-search-forward regex (point-at-eol) t) + (replace-match "" nil nil nil 2) + (org-set-tags nil t))))) + ;;; Org in other modes (defun km/load-orgstruct () (turn-on-orgstruct++) |