mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Add new emacs/hideshow module
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.
This commit is contained in:
28
modules/emacs/hideshow/config.el
Normal file
28
modules/emacs/hideshow/config.el
Normal file
@ -0,0 +1,28 @@
|
||||
;;; 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))))))
|
||||
|
Reference in New Issue
Block a user