spacemacs

Spacemacs - how to unset existing leader keys setting for major mode?


There are some leader keys settings in Spacemacs that seem inconvenient to me. These settings seem to be set during package initialization phase in corresponding layers. Setting new leader keys seems to be easy but how to delete existing ones?

For example, how to delete/revert this(random) setting after it was executed?

(spacemacs/set-leader-keys-for-major-mode 
  'enh-ruby-mode
  "iz"
  'spacemacs/ruby-insert-shebang)

Solution

  • You, probably, should find it in the source code how leader keys are set for your specific commands because it could be one of the following ways

    1. major mode
    ;; Just use the same `key` but set `def` to nil
    (spacemacs/set-leader-keys-for-major-mode 'enh-ruby-mode "iz" nil)
    

    Source @ syl20bnr/spacemacs

    1. minor mode

    Use spacemacs/set-leader-keys-for-minor-mode instead.

    1. "SPC" / leader key activated are removed like so:
    (spacemacs/set-leader-keys "gc" nil)