Skip to content

Instantly share code, notes, and snippets.

@bamanzi
Created November 14, 2013 13:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bamanzi/7466998 to your computer and use it in GitHub Desktop.
Save bamanzi/7466998 to your computer and use it in GitHub Desktop.
[emacs] anything-org-headings
(setq anything-c-source-org-headings
'((name . "Org Headings")
(headline . "^[*]+ ")
(condition . (eq major-mode 'org-mode))
(migemo)
(persistent-action . (lambda (elm)
(anything-c-action-line-goto elm)
(show-subtree)))
(action-transformer
. (lambda (actions candidate)
'(("Go to Line" . anything-c-action-line-goto)
("Go to section and fold otherse" . anything-c-outline-org-heading-hide-others))))
)
"Show Org headlings.
Differenct from `anything-c-source-org-headlines`, this one keeps faces")
(defun anything-org-headings ()
"Preconfigured anything to show org-like headings."
(interactive)
(let ((anything-candidate-number-limit 200))
(anything-other-buffer 'anything-c-source-org-headings "*org-mode headings*")))
(define-key global-map (kbd "<f5> h") 'anything-org-headings)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment