Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Adds hideshow folding rules for yaml-mode and ruby-mode
(defun +data-hideshow-forward-sexp (arg)
(let ((start (current-indentation)))
(unless (= start (current-indentation))
(require 'evil-indent-plus)
(let ((range (evil-indent-plus--same-indent-range)))
(goto-char (cadr range))
(map-put hs-special-modes-alist
'("\\s-*\\_<\\(?:[^:]+\\)\\_>" "" "#" +data-hideshow-forward-sexp nil))
(map-put hs-special-modes-alist
'("\\(def\\|do\\|{\\)" "\\(end\\|end\\|}\\)" "#"
(lambda (arg) (ruby-end-of-block)) nil))
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.