Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evil-want-keybinding warning due to evil-leader #215

Closed
willbush opened this issue Jan 1, 2019 · 3 comments
Closed

evil-want-keybinding warning due to evil-leader #215

willbush opened this issue Jan 1, 2019 · 3 comments

Comments

@willbush
Copy link
Contributor

willbush commented Jan 1, 2019

I'm getting the following warning despite using the recommended use-package
examples in the readme.

Warning (evil-collection): `evil-want-keybinding' was set to nil but not before loading evil.

Make sure to set `evil-want-keybinding' to nil before loading evil or evil-collection.

See https://github.com/emacs-evil/evil-collection/issues/60 for more details.

I found to fix it I had to (setq evil-want-keybinding nil) before loading
evil-leader, but I have no idea why.

Here is a minimal emacs configuration to demonstrate the issue:

(require 'package)

(setq package-enable-at-startup nil)

(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))

(package-initialize)

;; bootstrap use-package
(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

(require 'use-package)

(use-package evil-leader
  :ensure t
  :init
  ;; (setq evil-want-keybinding nil)
  (global-evil-leader-mode))

(use-package evil
  :ensure t
  :init
  (setq evil-want-integration t) ;; This is optional since it's already set to t by default.
  (setq evil-want-keybinding nil)
  :config
  (evil-mode 1))

(use-package evil-collection
  :after evil
  :ensure t
  :config
  (evil-collection-init))

Uncomment the line following line in the use-package init block for evil-leader to fix the issue.

  ;; (setq evil-want-keybinding nil)

Loading evil-leader after evil will also fix the issue, but consider the
following from the evil-leader readme:

Note: You should enable global-evil-leader-mode before you enable evil-mode,
otherwise evil-leader won’t be enabled in initial buffers (scratch,
Messages, …).

Emacs version:

GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.1) of 2018-12-25

Also note I'm using all latest packages from Melpa since my testing involved rm -rf ~/.emacs.d and using the above minimal config to reload them.

willbush added a commit to willbush/system that referenced this issue Jan 1, 2019
This opened up another issue see:

emacs-evil/evil-collection#215

where the work around is to `(setq evil-want-keybinding nil)` before loading
evil-leader.

I also moved some key bindings around. Haskell mode bindings are not working at
the moment.
@jojojames
Copy link
Collaborator

Thanks for the detailed report. I think evil-leader probably loads evil on its own which is why your problem comes up.

I think, if you're using evil-leader, you'll have to set that variable before (like you did) evil-leader loads.

@willbush
Copy link
Contributor Author

willbush commented Jan 1, 2019

Ah, you're right it does load evil. It probably should have occurred to me to look at its source. Think it might be worth mentioning in the readme that it might need to be set sooner if other packages load evil? I can make a pull request if desired. It might help other noobs like me that are coming from spacemacs, vim, or other editors.

@jojojames
Copy link
Collaborator

Yeah, adding an entry to the FAQ sounds good with me.

@willbush willbush closed this as completed Jan 3, 2019
tzskp1 added a commit to tzskp1/dotfiles that referenced this issue Jul 12, 2021
willbush added a commit to willbush/system that referenced this issue Dec 28, 2022
This opened up another issue see:

emacs-evil/evil-collection#215

where the work around is to `(setq evil-want-keybinding nil)` before loading
evil-leader.

I also moved some key bindings around. Haskell mode bindings are not working at
the moment.
abbaswasim added a commit to abbaswasim/dotfiles that referenced this issue Jul 14, 2023
emacs-evil/evil-collection#215 and disable elpy mode for now.
Also removes emacs mode from dired because I have EviL bindings for it now.
Disables setup llvm in .zprofile to a brew clang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants