Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Discover yafolding commands
;; Goal: have a magit-like menu to discover yafolding commands.
;; we use Mickey's version
;; We get a shorcut (M-f) which displays a list of actions associated with a hot key:
;; h will be for `yafolding-hide-element`, H to hide all, s to show the element, etc.
;; evil-mode users will need:
(evil-set-initial-state 'makey-key-mode 'emacs)
:context-menu '(yafolding
(description "folding based on indentation")
(lisp-switches ;; to adapt if neeeded
("-cf" "Case should fold search" case-fold-search t nil))
(lisp-arguments ;; to adapt
("=l" "context lines to show (occur)"
(lambda (dummy) (interactive) (read-number "Number of context lines to show: "))))
("h" "yafolding hide element" yafolding-hide-element)
("s" "show element" yafolding-show-element)
("H" "hide all" yafolding-hide-all)
("S" "show all" yafolding-show-all))
:bind "M-f")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.