35 lines
998 B
EmacsLisp
35 lines
998 B
EmacsLisp
;;; 201-hs-minor-mode.el --- hide-show code folding
|
|
|
|
;;; Commentary:
|
|
;; Online Documentation can be found at
|
|
;; https://www.emacswiki.org/emacs/HideShow
|
|
|
|
;;; Code:
|
|
|
|
(load-library "hideshow")
|
|
|
|
;; activate on following major modes
|
|
(add-hook 'c-mode-common-hook 'hs-minor-mode)
|
|
(add-hook 'emacs-lisp-mode-hook 'hs-minor-mode)
|
|
(add-hook 'java-mode-hook 'hs-minor-mode)
|
|
(add-hook 'lisp-mode-hook 'hs-minor-mode)
|
|
(add-hook 'perl-mode-hook 'hs-minor-mode)
|
|
(add-hook 'sh-mode-hook 'hs-minor-mode)
|
|
(add-hook 'rustic-mode-hook 'hs-minor-mode)
|
|
|
|
;; Hide the comments too when you do a 'hs-hide-all'
|
|
;;(setq hs-hide-comments nil)
|
|
|
|
;; Set whether isearch opens folded comments, code, or both
|
|
;; where x is code, comments, t (both), or nil (neither)
|
|
;; (setq hs-isearch-open 'code)
|
|
|
|
(global-set-key (kbd "C-+") 'toggle-hiding)
|
|
(global-set-key (kbd "C-\\") 'toggle-selective-display)
|
|
|
|
;; enable hs-minor-mode globaly
|
|
;; (hs-minor-mode 1)
|
|
|
|
;; End:
|
|
;;; 201-hs-minor-mode.el ends here
|