Skip to content

Instantly share code, notes, and snippets.

@mwfogleman
Last active January 30, 2019 09:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwfogleman/b5a9c9af0df43d703cff to your computer and use it in GitHub Desktop.
Save mwfogleman/b5a9c9af0df43d703cff to your computer and use it in GitHub Desktop.
Org-Mode: Go to the heading of an element, so you can use speed commands
; Speed commands are really useful, but I often want to make use of
; them when I'm not at the beginning of a header. This command brings
; you back to the beginning of an item's header, so that you can do
; speed commands.
(defun org-go-speed ()
"Goes to the beginning of an element's header, so that you can
execute speed commands."
(interactive)
(when (equal major-mode 'org-mode)
(if (org-at-heading-p)
(org-beginning-of-line)
(org-up-element))))
; bind-key comes from Use Package
(bind-key "C-c s" 'org-go-speed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment