Move hideshow config to core-editor.el

This commit is contained in:
Henrik Lissner 2016-02-23 13:07:21 -05:00
parent 3f431cb852
commit c0bc24a7f7
2 changed files with 28 additions and 32 deletions

View file

@ -153,6 +153,34 @@ enable multiple minor modes for the same regexp.")
(use-package goto-last-change
:commands goto-last-change)
(use-package hideshow
:commands (hs-minor-mode hs-toggle-hiding hs-already-hidden-p)
:config (setq hs-isearch-open t)
:init
(advice-add 'evil-toggle-fold :before 'narf*load-hs-minor-mode)
;; Prettify code folding in emacs ;;;;;;
(define-fringe-bitmap 'hs-marker [16 48 112 240 112 48 16] nil nil 'center)
(defface hs-face '((t (:background "#ff8")))
"Face to hightlight the ... area of hidden regions"
:group 'hideshow)
(defface hs-fringe-face '((t (:foreground "#888")))
"Face used to highlight the fringe on folded regions"
:group 'hideshow)
(setq hs-set-up-overlay
(lambda (ov)
(when (eq 'code (overlay-get ov 'hs))
(let* ((marker-string "*fringe-dummy*")
(marker-length (length marker-string))
(display-string (format " ... " (count-lines (overlay-start ov)
(overlay-end ov)))))
(put-text-property 0 marker-length 'display
(list 'right-fringe 'hs-marker 'hs-fringe-face) marker-string)
(put-text-property 0 (length display-string) 'face 'hs-face display-string)
(overlay-put ov 'before-string marker-string)
(overlay-put ov 'display display-string))))))
(use-package rotate-text
:commands (rotate-text rotate-text-backward)
:init