(add-hook 'ruby-mode-hook (lambda () (hs-minor-mode))) (eval-after-load "hideshow" '(add-to-list 'hs-special-modes-alist `(ruby-mode ,(rx (or "def" "class" "module" "do" "{" "[" "if" "else" "unless")) ; Block start ,(rx (or "}" "]" "end")) ; Block end ,(rx (or "#" "=begin")) ; Comment start ruby-forward-sexp nil)))
Fand es hier https://coderwall.com/p/u-l0ra/ruby-code-folding-in-emacs