Move hideshow config from ui/doom->emacs/hideshow
This commit is contained in:
parent
0c36b4450e
commit
417736ecf6
3 changed files with 22 additions and 21 deletions
|
@ -1,5 +1,10 @@
|
||||||
;;; emacs/hideshow/autoload.el -*- lexical-binding: t; -*-
|
;;; emacs/hideshow/autoload.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
(defface +hideshow-folded-face
|
||||||
|
`((t (:inherit font-lock-comment-face :weight light)))
|
||||||
|
"Face to hightlight `hideshow' overlays."
|
||||||
|
:group 'doom-themes)
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +hideshow-haml-forward-sexp (arg)
|
(defun +hideshow-haml-forward-sexp (arg)
|
||||||
(haml-forward-sexp arg)
|
(haml-forward-sexp arg)
|
||||||
|
@ -14,6 +19,19 @@
|
||||||
(goto-char (cadr range))
|
(goto-char (cadr range))
|
||||||
(end-of-line)))))
|
(end-of-line)))))
|
||||||
|
|
||||||
|
;;;###autoload
|
||||||
|
(defun +hideshow-set-up-overlay (ov)
|
||||||
|
(when (eq 'code (overlay-get ov 'hs))
|
||||||
|
(when (featurep 'vimish-fold)
|
||||||
|
(overlay-put
|
||||||
|
ov 'before-string
|
||||||
|
(propertize "…" 'display
|
||||||
|
(list vimish-fold-indication-mode
|
||||||
|
'empty-line
|
||||||
|
'vimish-fold-fringe))))
|
||||||
|
(overlay-put
|
||||||
|
ov 'display (propertize " [...] " 'face '+hideshow-folded-face))))
|
||||||
|
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; Indentation detection
|
;; Indentation detection
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
;;; emacs/hideshow/config.el -*- lexical-binding: t; -*-
|
;;; emacs/hideshow/config.el -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
(after! hideshow ; built-in
|
(after! hideshow ; built-in
|
||||||
(setq hs-hide-comments-when-hiding-all nil)
|
(setq hs-hide-comments-when-hiding-all nil
|
||||||
|
;; Nicer code-folding overlays (with fringe indicators)
|
||||||
|
hs-set-up-overlay #'+hideshow-set-up-overlay)
|
||||||
|
|
||||||
|
;; extra folding support for more languages
|
||||||
(unless (assq 't hs-special-modes-alist)
|
(unless (assq 't hs-special-modes-alist)
|
||||||
(setq hs-special-modes-alist
|
(setq hs-special-modes-alist
|
||||||
(append
|
(append
|
||||||
|
|
|
@ -63,23 +63,3 @@
|
||||||
;; considered an unreal buffer, so solaire-mode must be restored.
|
;; considered an unreal buffer, so solaire-mode must be restored.
|
||||||
(add-hook 'org-capture-mode-hook #'turn-on-solaire-mode))
|
(add-hook 'org-capture-mode-hook #'turn-on-solaire-mode))
|
||||||
|
|
||||||
|
|
||||||
(after! hideshow
|
|
||||||
(defface +doom-folded-face `((t (:inherit font-lock-comment-face :weight light)))
|
|
||||||
"Face to hightlight `hideshow' overlays."
|
|
||||||
:group 'doom-themes)
|
|
||||||
|
|
||||||
;; Nicer code-folding overlays (with fringe indicators)
|
|
||||||
(defun +doom-set-up-overlay (ov)
|
|
||||||
(when (eq 'code (overlay-get ov 'hs))
|
|
||||||
(when (featurep 'vimish-fold)
|
|
||||||
(overlay-put
|
|
||||||
ov 'before-string
|
|
||||||
(propertize "…" 'display
|
|
||||||
(list vimish-fold-indication-mode
|
|
||||||
'empty-line
|
|
||||||
'vimish-fold-fringe))))
|
|
||||||
(overlay-put
|
|
||||||
ov 'display (propertize " [...] " 'face '+doom-folded-face))))
|
|
||||||
(setq hs-set-up-overlay #'+doom-set-up-overlay))
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue