Skip to content

Instantly share code, notes, and snippets.

Embed
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)))
(forward-line)
(unless (= start (current-indentation))
(require 'evil-indent-plus)
(let ((range (evil-indent-plus--same-indent-range)))
(goto-char (cadr range))
(end-of-line)))))
(map-put hs-special-modes-alist
'yaml-mode
'("\\s-*\\_<\\(?:[^:]+\\)\\_>" "" "#" +data-hideshow-forward-sexp nil))
(map-put hs-special-modes-alist
'ruby-mode
'("\\(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.