It depends on the minor-mode/package. Many make this more configurable, which doesn't seem to be true in this case. I think the simplest thing here would be to just redefine the keymap yourself instead of trying to fiddle with it. Try this
(setq hs-minor-mode-map
(let ((map (make-sparse-keymap)))
;; These bindings roughly imitate those used by Outline mode.
(define-key map (kbd "C-c h C-h") 'hs-hide-block)
(define-key map (kbd "C-c h C-s") 'hs-show-block)
(define-key map (kbd "C-c h M-h") 'hs-hide-all)
(define-key map (kbd "C-c h M-s") 'hs-show-all)
(define-key map (kbd "C-c h C-l") 'hs-hide-level)
(define-key map (kbd "C-c h C-c") 'hs-toggle-hiding)
(define-key map [(shift mouse-2)] 'hs-mouse-toggle-hiding)
map))
Note: this alternative needs to be done before loading of hideshow
.
I took that from the definition of hs-minor-mode-map
which I found with C-h v
. Since it is defined with a defvar
you do not need to worry about your definition being overwritten when the package loads.
Update
Here's a shorter alternative
(define-key hs-minor-mode-map (kbd "C-c h") (lookup-key hs-minor-mode-map (kbd "C-c @")))
(define-key hs-minor-mode-map (kbd "C-c @") nil)
Note: this alternative needs to be done after hideshow
has been loaded.