0

The leader key works most buffers and in other special buffers like Help but not in others. Is there a setting for having evil-leader work in all buffers? This is an example of my evil-leader configuration

(use-package evil-leader
    :ensure t
    :config
    (global-evil-leader-mode t)
    (evil-leader/set-leader "<SPC>")
    (evil-leader/set-key
        "bd" 'kill-this-buffer
        "fd" 'init-file
        "ff" 'find-file
        "fs" 'save-buffer
        "k" 'switch-to-buffer
        "xh" 'mark-whole-buffer)

1 Answer 1

1

I suggest to use general.el since evil-leader is not update since 2014.

Here is a minimal example that works in *Message* and *Backtrace*

(use-package general
  :ensure t
  :after evil
  :config
  (general-create-definer tyrant-def
    :states '(normal insert motion emacs)
    :keymaps 'override
    :prefix "SPC"
    :non-normal-prefix "M-SPC")
  (tyrant-def "" nil)

  (general-def universal-argument-map
    "SPC u" 'universal-argument-more)

  (tyrant-def
    "bd" 'kill-this-buffer
    "fd" 'init-file
    "ff" 'find-file
    "fs" 'save-buffer
    "k" 'switch-to-buffer
    "xh" 'mark-whole-buffer))
6
  • For more detail, you can refer to my config Feb 19, 2022 at 3:45
  • Thanks for the recommendation! Would you happen to know how general compares to hydra? When I search for general, it looks like hydra comes up as a similar alternative
    – irregular
    Feb 19, 2022 at 4:31
  • general is a high-level abstraction of Emacs evil and native key bindings (which can interact with which-key), while hydra is more like transient (built in now), with which one can define one key page after another with various functions. Feb 19, 2022 at 9:35
  • Gotcha and out of curiosity, what is the (tyrant-def "" nil) for?
    – irregular
    Feb 21, 2022 at 8:06
  • 1
    maybe because of this, I don't really remember. Feb 21, 2022 at 9:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.