Brings better default code folding support to various languages, like yaml, ruby, matlab, haml and vimrc. Hideshow is still quite unsophisticated and will need the help of another package for complete code folding functionality. Perhaps origami or vimish fold. The code-folding functional in the feature/evil module will soon be replaced by that.
28 lines
1.1 KiB
EmacsLisp
28 lines
1.1 KiB
EmacsLisp
;;; emacs/hideshow/config.el -*- lexical-binding: t; -*-
|
|
|
|
(after! hideshow ; built-in
|
|
(setq hs-hide-comments-when-hiding-all nil)
|
|
|
|
(unless (assq 't hs-special-modes-alist)
|
|
(setq hs-special-modes-alist
|
|
(append
|
|
'((vimrc-mode "{{{" "}}}" "\"")
|
|
(yaml-mode "\\s-*\\_<\\(?:[^:]+\\)\\_>"
|
|
""
|
|
"#"
|
|
+hideshow-forward-block-by-indent nil)
|
|
(haml-mode "[#.%]" "\n" "/" +hideshow-haml-forward-sexp nil)
|
|
(ruby-mode "class\\|d\\(?:ef\\|o\\)\\|module\\|[[{]"
|
|
"end\\|[]}]"
|
|
"#\\|=begin"
|
|
ruby-forward-sexp)
|
|
(enh-ruby-mode "class\\|d\\(?:ef\\|o\\)\\|module\\|[[{]"
|
|
"end\\|[]}]"
|
|
"#\\|=begin"
|
|
enh-ruby-forward-sexp nil)
|
|
(matlab-mode "if\\|switch\\|case\\|otherwise\\|while\\|for\\|try\\|catch"
|
|
"end"
|
|
nil (lambda (arg) (matlab-forward-sexp))))
|
|
hs-special-modes-alist
|
|
'((t))))))
|
|
|