Created
June 21, 2018 23:12
-
-
Save hlissner/a62e307c5027777186af883fde08a679 to your computer and use it in GitHub Desktop.
Adds hideshow folding rules for yaml-mode and ruby-mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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